body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
    monospace;
}

/* Modern Header Styles */
.Hd-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: relative;
  z-index: 1000;
}

.Hd-left-section {
  display: flex;
  align-items: center;
  gap: 15px;
}

.Hd-hamburger-menu {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.Hd-hamburger-menu:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.Hd-line {
  width: 25px;
  height: 3px;
  background-color: white;
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
}

.Hd-title {
  font-size: 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.3s;
  color: white;
  text-decoration: none;
}

.Hd-title:hover {
  opacity: 0.9;
}

.Hd-header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Authentication Buttons */
.Hd-auth-buttons {
  display: flex;
  gap: 10px;
}

.Hd-login-button,
.Hd-signup-button {
  padding: 8px 16px;
  border: 2px solid white;
  background: transparent;
  color: white;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s;
  font-size: 14px;
}

.Hd-login-button:hover {
  background: white;
  color: #667eea;
}

.Hd-signup-button {
  background: white;
  color: #667eea;
}

.Hd-signup-button:hover {
  background: transparent;
  color: white;
}

/* User Section */
.Hd-user-section {
  position: relative;
}

.Hd-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.Hd-welcome-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

.Hd-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.3s;
}

.Hd-user-avatar:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.Hd-user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  min-width: 220px;
  z-index: 1001;
  overflow: hidden;
  animation: slideDown 0.3s ease;
}

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

.Hd-user-details {
  padding: 15px;
  background: #f8f9fa;
}

.Hd-user-details p {
  margin: 0;
  color: #333;
  line-height: 1.4;
}

.Hd-user-details strong {
  font-weight: 600;
}

.Hd-dropdown-divider {
  height: 1px;
  background: #eee;
  margin: 0;
}

.Hd-dropdown-item {
  width: 100%;
  padding: 12px 15px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #333;
  font-size: 14px;
  transition: background-color 0.3s;
}

.Hd-dropdown-item:hover {
  background: #f8f9fa;
}

.Hd-logout-item:hover {
  background: #ffe6e6;
  color: #dc3545;
}

/* Sidebar Styles */
.Hd-sidebar-bottom {
  position: fixed;
  top: 0;
  left: -350px;
  width: 350px;
  height: 100vh;
  background: white;
  z-index: 999;
  transition: left 0.3s ease;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  overflow-y: auto;
}

.Hd-sidebar-bottom.open {
  left: 0;
}

.Hd-sidebar-content {
  padding: 20px;
  padding-top: 80px; /* Account for header height */
}

.Hd-nav-section {
  margin-bottom: 30px;
}

.Hd-nav-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid #667eea;
}

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

.Hd-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  color: #555;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s;
  margin-bottom: 5px;
  font-size: 15px;
}

.Hd-nav-item:hover {
  background: #f0f2ff;
  color: #667eea;
  transform: translateX(5px);
}

.Hd-nav-item.legacy-item {
  color: #888;
  font-size: 14px;
}

.Hd-nav-item.legacy-item:hover {
  background: #f8f9fa;
  color: #666;
}

/* Icon placeholders (you can replace with actual icon fonts) */
.Hd-nav-item i::before {
  content: "•";
  font-weight: bold;
  display: inline-block;
  width: 16px;
}

/* Button navigation items */
button.Hd-nav-item {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  width: 100%;
  text-align: left;
}

/* Loading Styles */
.loading-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Success/Error Messages */
.success-message {
  background: #d4edda;
  color: #155724;
  padding: 12px;
  border-radius: 5px;
  margin-bottom: 20px;
  border: 1px solid #c3e6cb;
}

.error-message {
  background: #f8d7da;
  color: #721c24;
  padding: 12px;
  border-radius: 5px;
  margin-bottom: 20px;
  border: 1px solid #f5c6cb;
}

/* Responsive Design */
@media (max-width: 768px) {
  .Hd-header {
    padding: 10px 15px;
  }
  
  .Hd-title {
    font-size: 1.2rem;
  }
  
  .Hd-welcome-text {
    display: none;
  }
  
  .Hd-sidebar-bottom {
    width: 300px;
    left: -300px;
  }
  
  .Hd-auth-buttons {
    flex-direction: column;
    gap: 5px;
  }
  
  .Hd-login-button,
  .Hd-signup-button {
    padding: 6px 12px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .Hd-sidebar-bottom {
    width: 100vw;
    left: -100vw;
  }
}
.system-status {
  margin: 20px auto;
  max-width: 800px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Compact view for login page */
.system-status.compact {
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 480px;
  margin-top: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.system-status.compact.minimal {
  background: rgba(255, 255, 255, 0.9);
  padding: 16px 24px;
}

.system-status.compact.all-ok {
  background: rgba(209, 250, 229, 0.95);
  border: 1px solid #10b981;
}

.system-status.compact.degraded {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.system-status.compact .status-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 15px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.system-status.compact .status-icon {
  font-size: 16px;
}

.system-status.compact .status-details-compact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}

.system-status.compact .status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.system-status.compact .status-item strong {
  font-weight: 600;
  color: #555;
  min-width: 90px;
}

.system-status.compact .status-item .status-value {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  flex: 1 1;
  text-align: right;
}

/* Detailed view */
.system-status.detailed {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.system-status.detailed h3 {
  margin: 0 0 20px 0;
  color: #333;
  font-size: 24px;
}

.system-status.detailed h4 {
  margin: 15px 0 10px 0;
  color: #555;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 2px solid #667eea;
  padding-bottom: 5px;
}

.status-section {
  margin-bottom: 20px;
}

.status-badge {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 500;
  font-size: 14px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.status-row:last-child {
  border-bottom: none;
}

.status-row code {
  background: #f5f5f5;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

.status-online {
  color: #10b981;
  font-weight: 600;
}

.status-offline {
  color: #ef4444;
  font-weight: 600;
}

.status-badge.status-online {
  background: #d1fae5;
  color: #065f46;
}

.status-badge.status-offline {
  background: #fee2e2;
  color: #991b1b;
}

.status-footer {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
  text-align: center;
  color: #999;
}

.status-loading,
.status-error {
  text-align: center;
  padding: 10px;
  font-size: 13px;
  opacity: 0.8;
}

.status-error {
  color: #ef4444;
}

/* Responsive */
@media (max-width: 600px) {
  .system-status.compact .status-details-compact {
    flex-direction: column;
    gap: 6px;
  }
  
  .status-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* Authentication Styles */
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    gap: 0;
}

.auth-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 480px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h2 {
    color: #333;
    margin-bottom: 8px;
    font-size: 28px;
    font-weight: 600;
}

.auth-header p {
    color: #666;
    font-size: 16px;
    line-height: 1.5;
}

.auth-form {
    margin-bottom: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 16px;
    gap: 16px;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.auth-button {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #667eea;
    color: white;
}

.auth-button:hover:not(:disabled) {
    background: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.auth-button:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
}

.auth-button.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-button.primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #feb2b2;
    font-size: 14px;
}

.success-message {
    background: #c6f6d5;
    color: #22543d;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #9ae6b4;
    font-size: 14px;
}

.auth-footer {
    text-align: center;
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
}

.auth-footer p {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.auth-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.auth-link:hover {
    text-decoration: underline;
}

.trial-info {
    margin: 30px 0;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.trial-features h4 {
    color: #333;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
}

.trial-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.trial-features li {
    color: #666;
    margin-bottom: 6px;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.trial-features li::before {
    content: "✓";
    color: #38a169;
    font-weight: bold;
    margin-right: 8px;
}

.terms-text {
    font-size: 12px !important;
    color: #999 !important;
    margin-top: 16px !important;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-container {
        padding: 16px;
    }
    
    .auth-card {
        padding: 30px 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .auth-header h2 {
        font-size: 24px;
    }
    
    .auth-header p {
        font-size: 14px;
    }
}
/* Profile Page Styles */
.profile-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  background-color: #f8f9fa;
  min-height: 100vh;
}

.profile-header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.profile-header h1 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 2.5rem;
}

.profile-header p {
  margin: 0;
  color: #666;
  font-size: 1.1rem;
}

.profile-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-section {
  background: white;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.section-header h2 {
  margin: 0;
  color: #333;
  font-size: 1.5rem;
}

.edit-button {
  background: #007bff;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

.edit-button:hover {
  background: #0056b3;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.info-item:last-child {
  border-bottom: none;
}

.info-item label {
  font-weight: 600;
  color: #555;
  min-width: 150px;
}

.info-item span {
  color: #333;
  text-align: right;
  flex: 1 1;
}

.profile-form,
.password-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.form-group label {
  margin-bottom: 5px;
  font-weight: 600;
  color: #555;
}

.form-group input {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.cancel-button,
.save-button,
.change-password-button {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s;
}

.cancel-button {
  background: #6c757d;
  color: white;
}

.cancel-button:hover {
  background: #5a6268;
}

.save-button,
.change-password-button {
  background: #28a745;
  color: white;
}

.save-button:hover,
.change-password-button:hover {
  background: #218838;
}

.save-button:disabled,
.change-password-button:disabled {
  background: #6c757d;
  cursor: not-allowed;
}

.subscription-info {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.plan-badge,
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.plan-badge.free {
  background: #f8f9fa;
  color: #6c757d;
  border: 1px solid #dee2e6;
}

.plan-badge.premium {
  background: #ffc107;
  color: #212529;
}

.plan-badge.enterprise {
  background: #28a745;
  color: white;
}

.status-badge.active {
  background: #d4edda;
  color: #155724;
}

.status-badge.inactive {
  background: #f8d7da;
  color: #721c24;
}

.success-message {
  background: #d4edda;
  color: #155724;
  padding: 12px;
  border-radius: 5px;
  margin-bottom: 20px;
  border: 1px solid #c3e6cb;
}

.error-message {
  background: #f8d7da;
  color: #721c24;
  padding: 12px;
  border-radius: 5px;
  margin-bottom: 20px;
  border: 1px solid #f5c6cb;
}

/* Loading Styles */
.loading-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .profile-container {
    padding: 10px;
  }
  
  .profile-header h1 {
    font-size: 2rem;
  }
  
  .info-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  
  .info-item label {
    min-width: 0;
    min-width: initial;
  }
  
  .info-item span {
    text-align: left;
  }
  
  .form-actions {
    flex-direction: column;
  }
}

/* frontpage.css */

.frontpage {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  margin-top: 100px; /* Account for fixed header */
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 20px;
  margin-bottom: 60px;
}

.hero-section h1 {
  font-size: 3.5em;
  color: #333;
  margin: 0 0 20px 0;
  font-weight: bold;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.4em;
  color: #555;
  margin: 0 0 20px 0;
  font-weight: 600;
}

.hero-description {
  font-size: 1.1em;
  color: #666;
  max-width: 600px;
  margin: 0 auto 40px auto;
  line-height: 1.6;
}

.cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.primary-cta-btn, .secondary-cta-btn {
  padding: 15px 30px;
  border: none;
  border-radius: 50px;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 180px;
}

.primary-cta-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.primary-cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(102, 126, 234, 0.4);
}

.secondary-cta-btn {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
}

.secondary-cta-btn:hover {
  background: #667eea;
  color: white;
  transform: translateY(-3px);
}

/* Features Section */
.features-section {
  text-align: center;
  margin-bottom: 60px;
}

.features-section h2 {
  font-size: 2.5em;
  color: #333;
  margin-bottom: 40px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  grid-gap: 30px;
  gap: 30px;
  margin-top: 40px;
}

.feature-card {
  background: white;
  padding: 30px 20px;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  border-top: 4px solid transparent;
}

.feature-card:nth-child(1) { border-top-color: #ff6b6b; }
.feature-card:nth-child(2) { border-top-color: #4ecdc4; }
.feature-card:nth-child(3) { border-top-color: #45b7d1; }
.feature-card:nth-child(4) { border-top-color: #f9ca24; }

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.feature-icon {
  font-size: 3em;
  margin-bottom: 15px;
}

.feature-card h3 {
  color: #333;
  margin: 0 0 15px 0;
  font-size: 1.4em;
}

.feature-card p {
  color: #666;
  margin: 0;
  line-height: 1.6;
}

/* Benefits Section */
.benefits-section {
  background: #f8f9fa;
  padding: 50px 30px;
  border-radius: 20px;
  margin-bottom: 40px;
}

.benefits-section h2 {
  text-align: center;
  font-size: 2.5em;
  color: #333;
  margin-bottom: 40px;
}

.benefits-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  grid-gap: 30px;
  gap: 30px;
  max-width: 900px;
  margin: 0 auto;
}

.benefit-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
}

.benefit-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.benefit-icon {
  font-size: 2.5em;
  min-width: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.benefit-item h4 {
  color: #333;
  margin: 0 0 10px 0;
  font-size: 1.3em;
}

.benefit-item p {
  color: #666;
  margin: 0;
  line-height: 1.5;
}

/* Legacy styles for backward compatibility */
.FrontPage-container {
  min-height: 100vh;
  background: #f4f6fc;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.FrontPage-title {
  margin-top: 3rem;
  font-size: 2.5rem;
  font-weight: 600;
  color: #232946;
  letter-spacing: 1px;
  text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
  .frontpage {
    padding: 15px;
    margin-top: 80px;
  }

  .hero-section {
    padding: 40px 20px;
  }

  .hero-section h1 {
    font-size: 2.5em;
  }

  .hero-subtitle {
    font-size: 1.2em;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .primary-cta-btn, .secondary-cta-btn {
    width: 100%;
    max-width: 280px;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .benefits-list {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .benefit-item {
    flex-direction: column;
    text-align: center;
  }

  .benefit-icon {
    min-width: auto;
  }
}
/* ProjectPage.css */

.project-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  margin-top: 100px; /* Account for fixed header */
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 20px;
}

.project-header h1 {
  color: #333;
  font-size: 2.2em;
  margin: 0;
}

.create-project-btn {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.create-project-btn:hover {
  background: linear-gradient(135deg, #45a049, #4CAF50);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

/* Welcome Banner */
.welcome-banner {
  background: linear-gradient(135deg, #e8f5e8, #f0f8ff);
  border: 2px solid #4CAF50;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
}

.welcome-banner h2 {
  color: #2e7d32;
  margin: 0 0 10px 0;
  font-size: 1.5rem;
}

.welcome-banner p {
  color: #555;
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.5;
}

/* Error Message */
.error-message {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ef5350;
  border-radius: 5px;
  padding: 12px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 500;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #4CAF50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Create Form Overlay */
.create-form-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;
}

.create-form {
  background: white;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.create-form h2 {
  margin: 0 0 20px 0;
  color: #333;
}

.create-form input {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1.1em;
  margin-bottom: 20px;
  box-sizing: border-box;
}

.create-form input:focus {
  outline: none;
  border-color: #4CAF50;
}

.form-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.form-buttons button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.form-buttons button[type="submit"] {
  background: #4CAF50;
  color: white;
}

.form-buttons button[type="submit"]:hover {
  background: #45a049;
}

.form-buttons button[type="button"] {
  background: #f0f0f0;
  color: #333;
}

.form-buttons button[type="button"]:hover {
  background: #ddd;
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  grid-gap: 20px;
  gap: 20px;
}

.project-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  border-color: #4CAF50;
}

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

.project-card-header h3 {
  margin: 0;
  color: #333;
  font-size: 1.3em;
  line-height: 1.3;
  flex: 1 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.delete-project-btn {
  background: #f44336;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 1.2em;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}

.delete-project-btn:hover {
  opacity: 1;
  background: #d32f2f;
  transform: scale(1.1);
}

.delete-project-btn:active {
  transform: scale(0.95);
}

.project-info {
  margin-bottom: 20px;
}

.status-text {
  color: #666;
  margin: 0 0 15px 0;
  font-style: italic;
}

.file-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.file-indicator {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: bold;
}

.file-indicator.uploaded {
  background: #E8F5E8;
  color: #2E7D32;
}

.file-indicator.missing {
  background: #FFF3E0;
  color: #F57C00;
}

.file-indicator.completed {
  background: #E3F2FD;
  color: #1976D2;
}

.project-dates {
  display: flex;
  justify-content: space-between;
  opacity: 0.7;
}

.project-dates small {
  font-size: 0.8em;
}

.project-actions {
  display: flex;
  justify-content: flex-end;
}

.open-project-btn {
  background: linear-gradient(135deg, #2196F3, #1976D2);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.open-project-btn:hover {
  background: linear-gradient(135deg, #1976D2, #2196F3);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #666;
  grid-column: 1 / -1;
}

.empty-state h3 {
  color: #333;
  margin-bottom: 10px;
}

.empty-state p {
  margin-bottom: 30px;
  font-size: 1.1em;
}

.create-first-project-btn {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.create-first-project-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
  .project-page {
    padding: 15px;
    margin-top: 80px;
  }

  .project-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

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

  .project-dates {
    flex-direction: column;
    gap: 5px;
    text-align: center;
  }
}
.project-tabs-container {
  position: relative;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 100;
}

.project-tabs {
  display: flex;
  gap: 0;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
  position: relative;
}

.project-tab {
  flex: 1 1;
  background: transparent;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border-bottom: 3px solid transparent;
}

.project-tab:hover:not(.active) {
  background: #f9fafb;
  color: #374151;
}

.project-tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  background: #eff6ff;
  font-weight: 600;
}

.tab-icon {
  font-size: 1rem;
  line-height: 1;
}

.project-tab.active .tab-icon {
  opacity: 1;
  transform: scale(1.05);
}

.project-tab:hover .tab-icon {
  transform: none;
}

.tab-label {
  font-weight: inherit;
  font-size: 0.875rem;
  line-height: 1

.tab-badge {
  background: #e5e7eb;
  color: #374151;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.125rem 0.45rem;
  border-radius: 9px;
  min-width: 1.125rem;
  text-alleft: center;
  margin-top: 0.25rem;
}
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 8px;
  line-height: 1;
}

.project-tab.active .tab-badge {
  background: #2563eb;
  color: white;
  .project-tab {
    padding: 0.625rem 1rem;
    font-size: 0.85rem;
  }

  .tab-icon {
    font-size: 1.125rem;
  }
}

@media (max-width: 768px) {
  .project-tab {
    padding: 0.5rem 0.75rem;
  }

  .tab-icon {
    font-size: 1rem;
  }

  .tab-label {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .project-tab {
    padding: 0.5rem 0.5rem;
  }

  .tab-icon {
    font-size: 0.875rem;
  }

  .tab-label {
    font-size: 0.7rem;
  }

  .tab-badge {
    font-size: 0.625rem;
    padding: 0.1rem 0.4rem;
  }
}
.tab1-container {
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  background: #f9fafb;
  min-height: calc(100vh - 200px);
}

/* Description Banner */
.tab-description-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.tab-description-banner p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.tab-description-banner strong {
  font-weight: 600;
}

/* Upload Area */
.upload-area {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: 2px dashed rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  margin-bottom: 2rem;
  transition: all 0.3s ease;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.upload-area:hover,
.upload-area.drag-active {
  border-color: white;
  border-width: 3px;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.upload-icon {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  opacity: 0.95;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.upload-area h3 {
  margin: 0 0 0.75rem 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
}

.upload-area p {
  margin: 0.5rem 0;
  opacity: 0.95;
  font-size: 1rem;
}

.upload-hint {
  font-size: 0.875rem;
  opacity: 0.8;
  margin-top: 1.25rem;
}

.upload-button {
  display: inline-block;
  background: white;
  color: #667eea;
  padding: 0.875rem 2.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  margin-top: 1.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.upload-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  background: #f8f9fa;
}

.upload-progress {
  margin-top: 1.5rem;
}

.progress-steps {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: 8px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: white;
}

.step-icon {
  font-size: 1.1rem;
  min-width: 24px;
  text-align: center;
}

.step-text {
  font-weight: 500;
}

.progress-bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-fill {
  height: 100%;
  background: white;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Files List */
.files-list,
.files-table-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.files-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}

.files-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
}

.refresh-button {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.refresh-button:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

/* Files Table */
.files-table {
  width: 100%;
  border-collapse: collapse;
}

.files-table thead {
  background: #f9fafb;
  border-bottom: 2px solid #e5e7eb;
}

.files-table th {
  padding: 1rem 1.5rem;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.files-table tbody tr {
  border-bottom: 1px solid #e5e7eb;
  transition: all 0.2s ease;
  cursor: pointer;
}

.files-table tbody tr:hover {
  background: #f9fafb;
}

.files-table tbody tr.selected {
  background: #e0e7ff;
  border-left: 4px solid #667eea;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.1);
}

.files-table tbody tr.selected:hover {
  background: #dbeafe;
}

.files-table tbody tr:last-child {
  border-bottom: none;
}

.files-table td {
  padding: 1.25rem 1.5rem;
  vertical-align: middle;
}

/* File Cell */
.file-cell {
  width: 25%;
}

.file-info-inline {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.file-icon {
  font-size: 2rem;
  flex-shrink: 0;
  color: #667eea;
}

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

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

.file-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: #6b7280;
}

/* Duration Cell */
.duration-cell {
  width: 8%;
  text-align: center;
}

.duration-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: #374151;
  font-family: 'Courier New', monospace;
}

/* Status Cell */
.status-cell {
  width: 12%;
  text-align: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-icon {
  font-size: 1rem;
}

.status-uploaded {
  background: #dbeafe;
  color: #1e40af;
}

.status-processing {
  background: #fef3c7;
  color: #92400e;
}

.status-transcribed {
  background: #d1fae5;
  color: #065f46;
}

.status-processed {
  background: #e0e7ff;
  color: #3730a3;
}

.status-failed {
  background: #fee2e2;
  color: #991b1b;
}

.status-unknown {
  background: #f3f4f6;
  color: #6b7280;
}

/* PDF Cell */
.pdf-cell {
  width: 12%;
  text-align: center;
}

.pdf-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: #ef4444;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
  max-width: 200px;
}

.pdf-link:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(239, 68, 68, 0.3);
}

.pdf-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.pdf-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1;
  min-width: 0;
}

.pdf-delete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  flex-shrink: 0;
}

.pdf-delete-button:hover:not(:disabled) {
  background: #fecaca;
  border-color: #fca5a5;
  transform: scale(1.05);
}

.pdf-delete-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pdf-upload-inline {
  display: inline-block;
}

.pdf-upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  background: #f3f4f6;
  color: #6b7280;
  border: 2px dashed #d1d5db;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.pdf-upload-button:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
  color: #374151;
  transform: scale(1.02);
}

/* Transcription Cell */
.transcription-cell {
  width: 35%;
  max-width: 400px;
}

.transcribing-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #667eea;
  font-weight: 500;
  font-size: 0.9rem;
}

.transcription-error {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #fef2f2;
  border-radius: 6px;
  border-left: 3px solid #ef4444;
}

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

.error-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1 1;
}

.error-text {
  color: #dc2626;
  font-weight: 500;
  font-size: 0.875rem;
}

.retry-button {
  background: #ef4444;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  align-self: flex-start;
}

.retry-button:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid #e5e7eb;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.transcription-preview {
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.5;
  padding: 0.75rem;
  background: #f3f4f6;
  border-radius: 6px;
  border-left: 3px solid #10b981;
  max-height: 100px;
  overflow-y: auto;
}

.transcribe-button {
  background: #667eea;
  color: white;
  border: none;
  padding: 0.625rem 1.25rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.transcribe-button:hover:not(:disabled) {
  background: #5568d3;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(102, 126, 234, 0.3);
}

.transcribe-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Actions Cell */
.actions-cell {
  width: 15%;
  text-align: center;
}

.delete-button {
  background: transparent;
  color: #ef4444;
  border: 1px solid #fecaca;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.delete-button:hover {
  background: #fef2f2;
  border-color: #ef4444;
  transform: scale(1.1);
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #9ca3af;
}

.empty-state p {
  font-size: 1.125rem;
  margin: 0;
}

/* Files Grid */
.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  grid-gap: 1.5rem;
  gap: 1.5rem;
}

.file-card {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.file-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.file-card:hover::before {
  opacity: 1;
}

.file-card:hover {
  border-color: #2563eb;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.1), 0 2px 4px -1px rgba(37, 99, 235, 0.06);
  transform: translateY(-2px);
}

.file-card.selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.file-card.selected::before {
  opacity: 1;
}

.file-icon {
  font-size: 2.5rem;
  text-align: center;
  color: #667eea;
}

.file-info {
  flex: 1 1;
}

.file-name {
  margin: 0 0 0.75rem 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  display: flex;
  gap: 1.25rem;
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.875rem;
}

.status-badge {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.status-uploaded {
  background: #dbeafe;
  color: #1e40af;
}

.status-processing {
  background: #fef3c7;
  color: #d97706;
  animation: pulse 2s ease-in-out infinite;
}

.status-transcribed {
  background: #dcfce7;
  color: #16a34a;
}

.status-processed {
  background: #ddd6fe;
  color: #7c3aed;
}

.status-failed {
  background: #fee2e2;
  color: #dc2626;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* File Actions */
.file-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.action-button {
  flex: 1 1;
  min-width: -webkit-fit-content;
  min-width: fit-content;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.action-button.primary {
  background: #2563eb;
  color: white;
}

.action-button.primary:hover {
  background: #1d4ed8;
}

.action-button.success {
  background: #16a34a;
  color: white;
}

.action-button.success:hover {
  background: #15803d;
}

.action-button.info {
  background: #0891b2;
  color: white;
}

.action-button.info:hover {
  background: #0e7490;
}

.action-button.danger {
  background: #dc2626;
  color: white;
}

.action-button.danger:hover {
  background: #b91c1c;
}

/* Responsive */
@media (max-width: 1024px) {
  .files-table {
    font-size: 0.875rem;
  }
  
  .file-cell {
    width: 40%;
  }
  
  .transcription-cell {
    width: 45%;
  }
  
  .actions-cell {
    width: 15%;
  }
}

@media (max-width: 768px) {
  .tab1-container {
    padding: 1rem;
  }

  .upload-area {
    padding: 2rem 1rem;
  }

  .files-table {
    display: block;
    overflow-x: auto;
  }
  
  .files-table thead {
    display: none;
  }
  
  .files-table tbody,
  .files-table tr,
  .files-table td {
    display: block;
  }
  
  .files-table tr {
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
  }
  
  .files-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
  }
  
  .files-table td:last-child {
    border-bottom: none;
  }
  
  .file-cell,
  .transcription-cell,
  .actions-cell {
    width: 100%;
  }

  .files-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
}

/* ===== Client-Side Processing Toggle ===== */
.processing-mode-selector {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e7eb;
}

.processing-mode-toggle {
  margin-bottom: 1rem;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  -webkit-user-select: none;
          user-select: none;
}

.toggle-label input[type="checkbox"] {
  position: relative;
  width: 52px;
  height: 28px;
  -webkit-appearance: none;
          appearance: none;
  background: #cbd5e0;
  border-radius: 14px;
  outline: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.toggle-label input[type="checkbox"]:checked {
  background: #667eea;
}

.toggle-label input[type="checkbox"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.toggle-label input[type="checkbox"]::before {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  background: white;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-label input[type="checkbox"]:checked::before {
  transform: translateX(24px);
}

.toggle-text {
  font-size: 1rem;
  font-weight: 600;
  color: #1a202c;
}

.processing-mode-info {
  background: #f7fafc;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 0.75rem;
  border-left: 4px solid #667eea;
}

.processing-mode-info p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #4a5568;
}

.processing-mode-info strong {
  color: #2d3748;
  font-weight: 600;
}

/* Model Loading Banner */
.model-loading-banner {
  background: linear-gradient(135deg, #4299e1 0%, #667eea 100%);
  color: white;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.model-loading-banner p {
  margin: 0.5rem 0;
}

.model-loading-banner strong {
  font-size: 1.1rem;
}

.model-loading-banner .progress-bar {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  height: 8px;
  margin: 0.75rem 0;
  overflow: hidden;
}

.model-loading-banner .progress-fill {
  background: white;
  height: 100%;
  transition: width 0.3s ease;
  border-radius: 8px;
}

/* Client-Side Info Banner */
.client-side-info-banner {
  background: linear-gradient(135deg, #16a34a 0%, #059669 100%);
  color: white;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.client-side-info-banner p {
  margin: 0;
  line-height: 1.6;
  font-size: 0.95rem;
}

.client-side-info-banner strong {
  font-weight: 600;
  font-size: 1.05rem;
}

/* Local Badge */
.local-badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.25rem 0.625rem;
  background: #16a34a;
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 10px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  box-shadow: 0 1px 3px rgba(22, 163, 74, 0.3);
}

/* Enhanced Progress Modal Overlay */
.upload-progress-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.progress-modal {
  background: white;
  border-radius: 20px;
  padding: 3rem 2.5rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.4s ease;
}

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

.processing-animation {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid #e5e7eb;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.processing-title {
  text-align: center;
  color: #111827;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1.5rem 0;
}

.browser-warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #f59e0b;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #78350f;
  animation: pulse 2s ease-in-out infinite;
}

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

.browser-warning strong {
  font-weight: 700;
  color: #92400e;
}

.time-estimate {
  background: #f0f9ff;
  border: 2px solid #0ea5e9;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
}

.time-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.95rem;
}

.time-row:not(:last-child) {
  border-bottom: 1px solid #bae6fd;
}

.time-label {
  color: #075985;
  font-weight: 500;
}

.time-value {
  color: #0c4a6e;
  font-weight: 700;
}

.time-row.elapsed {
  background: #dbeafe;
  margin: 0.5rem -1.25rem -1rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 10px 10px;
  animation: fadeIn 0.5s ease;
}

.time-row.elapsed .time-value {
  color: #0369a1;
  font-size: 1.1rem;
}

.progress-modal .progress-steps {
  background: #f9fafb;
  padding: 1.25rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.progress-modal .step-item {
  color: #6b7280;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.progress-modal .step-item:last-child {
  margin-bottom: 0;
}

.progress-modal .step-item.active {
  color: #667eea;
  font-weight: 600;
}

.progress-modal .step-item.active .step-icon {
  animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.progress-bar-container {
  margin-bottom: 1.5rem;
}

.progress-modal .progress-bar {
  height: 12px;
  background: #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-modal .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.progress-text {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
}

.processing-info {
  text-align: center;
  color: #6b7280;
  font-size: 0.875rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

/* ========================================
   Waveform Editor Container
   ======================================== */

.waveform-editor-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

/* ========================================
   Header Section
   ======================================== */

.waveform-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}

.waveform-editor-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
}

/* ========================================
   Zoom Controls
   ======================================== */

.waveform-zoom-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #f8fafc;
  padding: 0.5rem 1rem;
  border-radius: 6px;
}

.zoom-btn {
  padding: 0.375rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: white;
  color: #475569;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.zoom-btn:hover:not(:disabled) {
  background: #e2e8f0;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.zoom-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.zoom-slider {
  width: 200px;
  height: 6px;
  cursor: pointer;
  accent-color: #2563eb;
}

.zoom-level {
  font-size: 0.9rem;
  color: #64748b;
  font-weight: 600;
  min-width: 40px;
  text-align: center;
}

/* ========================================
   Waveform Container
   ======================================== */

.waveform-wrapper {
  position: relative;
  margin-bottom: 1rem;
}

.waveform-container {
  width: 100%;
  min-height: 200px;
  max-height: 250px;
  background: #f8fafc;
  border-radius: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 2px solid #e2e8f0;
}

/* Loading State */
.waveform-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, 0.95);
  color: #64748b;
  font-size: 1.1rem;
  z-index: 10;
  border-radius: 6px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

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

/* ========================================
   Playback Controls
   ======================================== */

.waveform-playback-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 2px solid #e2e8f0;
  flex-wrap: wrap;
}

.waveform-control-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.waveform-control-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.play-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.play-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
}

.stop-btn {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.stop-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(239, 68, 68, 0.3);
}

.refresh-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.refresh-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

.align-btn {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
}

.align-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(139, 92, 246, 0.3);
}

/* Compact silence threshold control */
.silence-threshold-compact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.silence-threshold-compact label {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
  margin: 0;
  cursor: help;
}

.threshold-slider-compact {
  width: 100px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(to right, #10b981 0%, #f59e0b 50%, #ef4444 100%);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.threshold-slider-compact::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: white;
  border: 2px solid #8b5cf6;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  -webkit-transition: all 0.2s;
  transition: all 0.2s;
}

.threshold-slider-compact::-webkit-slider-thumb:hover {
  background: #f3f4f6;
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(139, 92, 246, 0.4);
}

.threshold-slider-compact::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: white;
  border: 2px solid #8b5cf6;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  -moz-transition: all 0.2s;
  transition: all 0.2s;
}

.threshold-slider-compact::-moz-range-thumb:hover {
  background: #f3f4f6;
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(139, 92, 246, 0.4);
}

/* ========================================
   Time Display
   ======================================== */

.waveform-time-display {
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  color: #1e293b;
  font-weight: 600;
  margin-left: auto;
  padding: 0.5rem 1rem;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

/* ========================================
   Silence Alignment Controls
   ======================================== */

.waveform-silence-controls {
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
}

.silence-controls-header {
  margin-bottom: 1rem;
}

.silence-controls-header h5 {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 0.25rem 0;
}

.silence-help-text {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0;
}

.silence-controls-row {
  display: flex;
  align-items: flex-end;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.silence-threshold-control {
  flex: 1 1;
  min-width: 300px;
}

.silence-threshold-control label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.5rem;
}

.threshold-slider {
  width: 100%;
  height: 6px;
  cursor: pointer;
  accent-color: #8b5cf6;
}

.threshold-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #94a3b8;
}

.align-btn {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  white-space: nowrap;
}

.align-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(139, 92, 246, 0.3);
}

/* ========================================
   Legend
   ======================================== */

.waveform-legend {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
  font-size: 0.9rem;
  color: #475569;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-color {
  width: 24px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.legend-color.delete {
  background: rgba(239, 68, 68, 0.5);
}

.legend-color.keep {
  background: rgba(34, 197, 94, 0.5);
}

.legend-help {
  margin-left: auto;
  color: #64748b;
  font-style: italic;
  font-size: 0.85rem;
}

/* ========================================
   Region Styling (WaveSurfer regions)
   ======================================== */

/* Custom styling for region labels */
[data-region-label] {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border-radius: 3px;
  pointer-events: none;
}

/* Resize handles */
.wavesurfer-handle {
  background: rgba(0, 0, 0, 0.5) !important;
  width: 6px !important;
  cursor: ew-resize !important;
}

.wavesurfer-handle:hover {
  background: rgba(0, 0, 0, 0.8) !important;
  width: 8px !important;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 1024px) {
  .waveform-editor-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .waveform-zoom-controls {
    width: 100%;
    justify-content: space-between;
  }

  .zoom-slider {
    flex: 1 1;
    max-width: 200px;
  }
}

@media (max-width: 768px) {
  .waveform-container {
    min-height: 250px;
  }

  .waveform-editor-container {
    padding: 1rem;
  }

  .zoom-slider {
    width: 120px;
  }

  .waveform-legend {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .legend-help {
    width: 100%;
    margin-left: 0;
    text-align: center;
  }

  .waveform-playback-controls {
    flex-wrap: wrap;
  }

  .waveform-time-display {
    width: 100%;
    text-align: center;
    margin-left: 0;
  }

  .silence-controls-row {
    flex-direction: column;
    align-items: stretch;
  }

  .silence-threshold-control {
    min-width: 100%;
  }

  .align-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .waveform-editor-title {
    font-size: 1rem;
  }

  .waveform-control-btn {
    padding: 0.375rem 1rem;
    font-size: 0.85rem;
  }

  .zoom-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
  }
}

/* PDFRegionSelector.css */

.pdf-region-selector {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.pdf-region-selector.loading,
.pdf-region-selector.error {
  text-align: center;
  padding: 4rem 2rem;
}

.loading-spinner {
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.error-message {
  background: #fee2e2;
  border: 2px solid #ef4444;
  border-radius: 8px;
  padding: 2rem;
  max-width: 500px;
  margin: 0 auto;
}

.error-message h3 {
  color: #dc2626;
  margin-bottom: 1rem;
}

.error-message p {
  color: #991b1b;
  margin-bottom: 1.5rem;
}

/* Header */
.selector-header {
  margin-bottom: 2rem;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 1rem;
}

.selector-header h3 {
  color: #1e293b;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.selector-header p {
  color: #64748b;
  font-size: 0.95rem;
}

/* Controls */
.selector-controls {
  background: #f8fafc;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.control-group {
  margin-bottom: 1rem;
}

.control-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  cursor: pointer;
}

.control-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.position-controls {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.input-group label {
  font-weight: 500;
  color: #475569;
  white-space: nowrap;
}

.input-group input[type="number"] {
  width: 120px;
  padding: 0.5rem;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: 'Courier New', monospace;
}

.input-group input[type="number"]:disabled {
  background: #e2e8f0;
  cursor: not-allowed;
}

.input-group input[type="number"]:focus {
  outline: none;
  border-color: #3b82f6;
}

.selection-info {
  background: #dbeafe;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  color: #1e40af;
  font-size: 0.9rem;
}

.selection-info strong {
  font-weight: 700;
  font-size: 1.1rem;
}

/* Page Navigation */
.page-navigation {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid #cbd5e1;
  margin-top: 1rem;
}

.btn-page-nav {
  padding: 0.5rem 1rem;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  color: #334155;
  transition: all 0.2s;
}

.btn-page-nav:hover:not(:disabled) {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.btn-page-nav:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-indicator {
  font-weight: 600;
  color: #475569;
  padding: 0 0.5rem;
}

/* PDF Text Container */
.pdf-text-container {
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  max-height: 500px;
  overflow-y: auto;
  background: #ffffff;
  margin-bottom: 1.5rem;
}

.pdf-text-content {
  padding: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.8;
  color: #1e293b;
  font-family: 'Georgia', serif;
  -webkit-user-select: text;
          user-select: text;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Page Markers */
.pdf-page {
  margin-bottom: 2rem;
}

.page-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 6px 6px 0 0;
  margin: 0 1.5rem;
  margin-top: 1.5rem;
}

.page-content {
  padding: 1.5rem;
  border-left: 3px solid #e5e7eb;
  margin-left: 1.5rem;
}

/* Selected Region Highlighting */
.selected-region {
  background: rgba(59, 130, 246, 0.25);
  border: 2px solid #3b82f6;
  border-radius: 3px;
  padding: 2px 0;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  animation: pulse-highlight 2s ease-in-out infinite;
}

@keyframes pulse-highlight {
  0%, 100% {
    background: rgba(59, 130, 246, 0.25);
  }
  50% {
    background: rgba(59, 130, 246, 0.35);
  }
}

/* Selection Preview */
.selection-preview {
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.selection-preview h4 {
  color: #334155;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.preview-text {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #475569;
  font-family: 'Georgia', serif;
  max-height: 150px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.preview-stats {
  margin-top: 0.75rem;
  color: #64748b;
  font-size: 0.85rem;
  font-style: italic;
}

/* Action Buttons */
.selector-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 2px solid #e5e7eb;
}

.btn-cancel,
.btn-confirm {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cancel {
  background: #f1f5f9;
  color: #475569;
  border: 2px solid #cbd5e1;
}

.btn-cancel:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.btn-confirm {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.btn-confirm:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
}

.btn-confirm:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
}

/* Scrollbar Styling */
.pdf-text-container::-webkit-scrollbar {
  width: 12px;
}

.pdf-text-container::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 6px;
}

.pdf-text-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 6px;
}

.pdf-text-container::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Responsive Design */
@media (max-width: 768px) {
  .pdf-region-selector {
    padding: 1rem;
  }
  
  .position-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .input-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .input-group input[type="number"] {
    width: 100%;
  }
  
  .page-navigation {
    flex-wrap: wrap;
  }
  
  .selector-actions {
    flex-direction: column;
  }
  
  .btn-cancel,
  .btn-confirm {
    width: 100%;
  }
}

/* Mode Toggle */
.mode-toggle-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  margin-bottom: 1rem;
}

.mode-label {
  font-weight: 600;
  color: #475569;
  font-size: 1rem;
}

.mode-buttons {
  display: flex;
  gap: 0.75rem;
}

.mode-btn {
  padding: 0.75rem 1.5rem;
  border: 2px solid #cbd5e1;
  background: white;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.95rem;
  color: #475569;
}

.mode-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.mode-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: #667eea;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

/* Smart Search Configuration */
.smart-search-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-left: auto;
}

.smart-search-config {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: #f0fdf4;
  border: 2px solid #10b981;
  border-radius: 8px;
}

.config-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.config-row label {
  font-weight: 500;
  color: #1e293b;
  min-width: 180px;
}

.config-select {
  padding: 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: white;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.config-select:hover {
  border-color: #10b981;
}

.config-select:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.config-input {
  width: 80px;
  padding: 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.9rem;
  text-align: center;
  transition: border-color 0.2s;
}

.config-input:hover {
  border-color: #10b981;
}

.config-input:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.config-row span {
  color: #64748b;
  font-size: 0.9rem;
}

.btn-smart-search {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.95rem;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
  margin-top: 0.5rem;
}

.btn-smart-search:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 4px 6px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.btn-smart-search:active {
  transform: translateY(0);
}

.smart-search-hint {
  color: #047857;
  font-size: 0.75rem;
  font-style: italic;
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* Sentence Selection */
.sentence-selection-container {
  padding: 1rem;
  background: #fafafa;
}

.sentence-selection-empty {
  padding: 3rem;
  text-align: center;
  color: #94a3b8;
  font-style: italic;
}

.sentence-selection-instructions {
  background: #e0e7ff;
  color: #3730a3;
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  border-left: 4px solid #667eea;
}

.sentences-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.sentence-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.sentence-item:hover {
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
  transform: translateX(3px);
}

.sentence-item.sentence-start {
  background: #d1fae5;
  border-color: #10b981;
  border-width: 3px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.sentence-item.sentence-end {
  background: #dbeafe;
  border-color: #3b82f6;
  border-width: 3px;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.sentence-item.sentence-in-range {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.sentence-number {
  font-weight: 700;
  color: #667eea;
  min-width: 40px;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
}

.sentence-text {
  flex: 1 1;
  line-height: 1.6;
  color: #1e293b;
  font-size: 0.95rem;
}

.sentence-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.start-badge {
  background: #10b981;
  color: white;
}

.end-badge {
  background: #3b82f6;
  color: white;
}

.sentences-truncated {
  padding: 1rem;
  text-align: center;
  color: #64748b;
  font-style: italic;
  background: #fef3c7;
  border-radius: 6px;
  margin-top: 1rem;
  border: 1px solid #fbbf24;
}

.selection-info-sentence {
  background: #f0f9ff;
  border: 2px solid #3b82f6;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  color: #1e3a8a;
  font-size: 0.9rem;
  line-height: 1.8;
  min-width: 300px;
  flex: 1 1 auto;
}

.selection-info-sentence strong {
  color: #1e40af;
}

.sentence-fine-tune {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: white;
  padding: 1rem;
  border-radius: 6px;
  border: 2px solid #cbd5e1;
  flex-wrap: wrap;
}

.sentence-fine-tune label {
  font-weight: 500;
  color: #475569;
  font-size: 0.9rem;
  white-space: nowrap;
}

.fine-tune-input {
  width: 100px;
  padding: 0.5rem;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: 'Courier New', monospace;
  background: white;
}

.fine-tune-input:focus {
  outline: none;
  border-color: #3b82f6;
}

.btn-reset-selection {
  padding: 0.75rem 1.5rem;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
  white-space: nowrap;
}

.btn-reset-selection:hover:not(:disabled) {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.btn-reset-selection:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Scrollbar for sentence list */
.sentences-list::-webkit-scrollbar {
  width: 10px;
}

.sentences-list::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 5px;
}

.sentences-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 5px;
}

.sentences-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* New styles for single-position selection mode */

/* Selected sentence highlight */
.sentence-item.sentence-selected {
  background: #d1fae5;
  border-color: #10b981;
  border-width: 3px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Sentence in current range (for context) */
.sentence-item.sentence-in-current-range {
  background: #fef3c7;
  border-color: #f59e0b;
  opacity: 0.7;
}

/* Selected badge for current position */
.selected-badge {
  background: #10b981;
  color: white;
}

/* Sentence character range display */
.sentence-chars {
  font-size: 0.75rem;
  color: #64748b;
  font-family: 'Courier New', monospace;
  margin-left: auto;
  white-space: nowrap;
}

.text-before,
.text-after {
  color: #1e293b;
  line-height: 1.6;
}

.text-truncated {
  color: #9ca3af;
  font-style: italic;
}

.text-with-marker {
  font-family: 'Georgia', serif;
  font-size: 1rem;
  line-height: 1.8;
  padding: 1.5rem;
  background: #f8fafc;
  border-radius: 8px;
}

/* Selection info box */
.selection-info-box {
  background: #eff6ff;
  border: 2px solid #3b82f6;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  color: #1e3a8a;
  font-weight: 500;
  flex: 1 1 auto;
  min-width: 300px;
}

.selection-info-box strong {
  color: #1e40af;
  font-weight: 700;
}

/* Position fine-tune control */
.position-fine-tune {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: white;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 2px solid #e5e7eb;
}

.position-fine-tune label {
  font-weight: 500;
  color: #475569;
  white-space: nowrap;
}

/* Character mode instructions */
.character-mode-instructions {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border-radius: 4px;
}

.character-mode-instructions strong {
  color: #1e40af;
  font-weight: 600;
}

.pdf-full-text {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  border: 2px solid #e5e7eb;
  min-height: 400px;
  max-height: 600px;
  overflow-y: auto;
  font-family: 'Georgia', serif;
  line-height: 1.8;
  font-size: 1rem;
  color: #1e293b;
}

/* Context info for sentence selection */
.context-info {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: #fef3c7;
  border-radius: 4px;
  font-size: 0.875rem;
  color: #92400e;
}

.tab3-container {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.tab-header {
  margin-bottom: 2rem;
}

.tab-header h2 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  color: #1e293b;
}

.tab-header p {
  color: #64748b;
  font-size: 0.95rem;
}

/* File Selection Card */
.file-selection-card {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.input-label {
  display: block;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.file-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.95rem;
  color: #334155;
  background: white;
  cursor: pointer;
  transition: border-color 0.2s;
  margin-bottom: 1rem;
}

.file-select:hover {
  border-color: #94a3b8;
}

.file-select:focus {
  outline: none;
  border-color: #3b82f6;
}

.detect-button {
  padding: 0.75rem 2rem;
  background: #16a34a;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
}

.detect-button:hover:not(:disabled) {
  background: #15803d;
}

.detect-button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.clear-button {
  padding: 0.75rem 1.5rem;
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
}

.clear-button:hover {
  background: #b91c1c;
}

/* Audio Player - Sticky at Top */
.tab3-audio-player {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 100;
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.audio-player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.audio-player-header h4 {
  font-size: 1.1rem;
  color: #1e293b;
  margin: 0;
}

.audio-time {
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  color: #64748b;
  font-weight: 600;
}

.waveform-container {
  width: 100%;
  margin-bottom: 1rem;
  background: #f8fafc;
  border-radius: 4px;
  overflow: hidden;
}

.audio-controls {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.control-btn {
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.control-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.play-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.play-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
}

.stop-btn {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.stop-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(239, 68, 68, 0.3);
}

/* Duplicate Results - Scrollable */
.duplicate-results {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  max-height: 600px;
  overflow-y: auto;
}

.duplicate-results::-webkit-scrollbar {
  width: 8px;
}

.duplicate-results::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.duplicate-results::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.duplicate-results::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Results Header */
.results-header {
  padding-bottom: 1rem;
  border-bottom: 2px solid #f1f5f9;
  margin-bottom: 1.5rem;
}

.results-header h3 {
  font-size: 1.4rem;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.selection-summary {
  color: #64748b;
  font-size: 0.95rem;
}

.selection-summary strong {
  color: #dc2626;
  font-weight: 600;
}

/* Duplicate Groups List */
.duplicate-groups-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.duplicate-group-card {
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.2s;
  margin-bottom: 0.75rem;
}

.duplicate-group-card:hover {
  border-color: #cbd5e1;
}

.group-header {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: #f8fafc;
  cursor: pointer;
  gap: 0.75rem;
  transition: background 0.2s;
  min-height: 40px;
}

.group-header:hover {
  background: #f1f5f9;
}

.expand-icon {
  font-size: 1rem;
  color: #64748b;
  line-height: 1;
  flex-shrink: 0;
  width: 20px;
}

.group-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 80px;
}

.group-text-inline {
  flex: 1 1;
  color: #475569;
  font-style: italic;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 0.5rem;
}

.group-meta-inline {
  font-size: 0.8rem;
  color: #64748b;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Group Occurrences */
.group-occurrences {
  background: white;
  padding: 0.75rem;
  border-top: 2px solid #e2e8f0;
}

.occurrence-card {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
}

.occurrence-card:last-child {
  margin-bottom: 0;
}

.occurrence-card.last-occurrence {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.occurrence-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.checkbox-container input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.checkbox-container input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.occurrence-title {
  font-weight: 600;
  color: #334155;
  font-size: 0.95rem;
}

.action-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.action-badge.delete {
  background: #dc2626;
  color: white;
}

.action-badge.keep {
  background: #16a34a;
  color: white;
}

.occurrence-details {
  color: #475569;
  font-size: 0.85rem;
}

.occurrence-details p {
  margin: 0.2rem 0;
  line-height: 1.5;
}

.timestamp-link {
  color: #2563eb;
  cursor: pointer;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  transition: all 0.2s;
  display: inline-block;
  background: rgba(37, 99, 235, 0.1);
}

.timestamp-link:hover {
  background: rgba(37, 99, 235, 0.2);
  color: #1e40af;
  transform: translateY(-1px);
}

.timestamp-link:active {
  transform: translateY(0);
}

.occurrence-text {
  font-style: italic;
  color: #64748b;
}

/* Review Actions */
.review-actions {
  display: flex;
  justify-content: center;
  padding-top: 1.5rem;
  border-top: 2px solid #f1f5f9;
}

.confirm-button {
  padding: 1rem 3rem;
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 6px rgba(220, 38, 38, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.confirm-button.processing {
  background: #f59e0b;
  cursor: wait;
  box-shadow: 0 4px 6px rgba(245, 158, 11, 0.3);
}

.confirm-button.processing:hover {
  background: #f59e0b;
  transform: none;
}

.confirm-button:hover:not(:disabled) {
  background: #b91c1c;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(220, 38, 38, 0.3);
}

.confirm-button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Spinner Animation */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #94a3b8;
  font-size: 1rem;
}

.empty-state p {
  margin: 0;
}

/* Completion Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
}

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

.modal-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e2e8f0;
}

.modal-header h3 {
  font-size: 1.75rem;
  color: #10b981;
  margin: 0;
  font-weight: 700;
}

.modal-body {
  text-align: center;
  margin-bottom: 2rem;
}

.modal-body p {
  color: #475569;
  font-size: 1rem;
  line-height: 1.6;
  margin: 0.5rem 0;
}

.modal-body p:first-child {
  font-weight: 600;
  color: #1e293b;
  font-size: 1.1rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  flex-direction: column;
}

.modal-button {
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.modal-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.modal-button:active {
  transform: translateY(0);
}

.modal-button.primary-button {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.modal-button.primary-button:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.modal-button.secondary-button {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.modal-button.secondary-button:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

/* Client-Side Detection Progress */
.detection-progress {
  margin-top: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
  border-radius: 8px;
  border: 1px solid #bae6fd;
}

.progress-status {
  margin: 0 0 0.75rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0c4a6e;
  text-align: center;
}

.detection-progress .progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.detection-progress .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9 0%, #0284c7 100%);
  transition: width 0.3s ease;
  border-radius: 4px;
}

/* Audio Assembly Progress */
.assembly-progress {
  margin-top: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border-radius: 8px;
  border: 1px solid #6ee7b7;
}

.assembly-progress .progress-status {
  margin: 0 0 0.75rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #065f46;
  text-align: center;
}

.assembly-progress .progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 4px;
  overflow: hidden;
}

.assembly-progress .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
  transition: width 0.3s ease;
  border-radius: 4px;
}

/* Assembled Audio Info */
.assembled-audio-info {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-radius: 12px;
  border: 2px solid #10b981;
  box-shadow: 0 4px 6px rgba(16, 185, 129, 0.1);
}

.assembled-audio-info h4 {
  margin: 0 0 1rem 0;
  font-size: 1.2rem;
  color: #065f46;
  text-align: center;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  grid-gap: 1rem;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-item .label {
  font-size: 0.85rem;
  color: #059669;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.info-item .value {
  font-size: 1.1rem;
  color: #064e3b;
  font-weight: 700;
}

.download-button {
  width: 100%;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
}

/* New top-positioned action section */
.review-actions-top {
  position: -webkit-sticky;
  position: sticky;
  top: 10px;
  z-index: 100;
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.assembly-progress-inline {
  padding: 1rem;
  background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
  border-radius: 8px;
  border: 2px solid #f59e0b;
}

.assembly-progress-inline .progress-status {
  margin: 0 0 0.75rem 0;
  font-weight: 600;
  color: #92400e;
  font-size: 0.95rem;
}

.assembled-audio-info-inline {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-radius: 10px;
  border: 2px solid #10b981;
}

.assembled-audio-info-inline .success-icon {
  font-size: 1.5rem;
}

.assembled-audio-info-inline .info-text {
  flex: 1 1;
  font-weight: 600;
  color: #065f46;
  font-size: 1rem;
}

.download-button-inline {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
  white-space: nowrap;
}

.download-button-inline:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(16, 185, 129, 0.3);
}

.assemble-button {
  width: 100%;
}


.download-button:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(16, 185, 129, 0.3);
}

.download-button:active {
  transform: translateY(0);
}

/* Download Format Buttons */
.download-format-button {
  padding: 0.5rem 1rem;
  background: white;
  color: #475569;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.download-format-button:hover {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(59, 130, 246, 0.2);
}

.download-format-button:active {
  transform: translateY(0);
}


/* Tab 4: Results Styles */
.tab4-container {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.results-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Statistics Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  grid-gap: 1.5rem;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-card.success {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 2px solid #86efac;
}

.stat-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.stat-info {
  flex: 1 1;
}

.stat-label {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1;
}

.stat-subtitle {
  font-size: 0.9rem;
  color: #16a34a;
  font-weight: 600;
  margin-top: 0.5rem;
}

/* Audio Player Card */
.audio-player-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.audio-player-card h3 {
  font-size: 1.3rem;
  color: #1e293b;
  margin-bottom: 1.5rem;
}

.waveform-container {
  background: #f8fafc;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border: 2px solid #e2e8f0;
}

.player-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.time-display {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  color: #475569;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.time-separator {
  color: #cbd5e1;
  margin: 0 0.5rem;
}

.control-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.control-btn {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.control-btn.play-pause {
  background: #3b82f6;
  color: white;
}

.control-btn.play-pause:hover:not(:disabled) {
  background: #2563eb;
  transform: scale(1.05);
}

.control-btn.stop {
  background: #64748b;
  color: white;
}

.control-btn.stop:hover:not(:disabled) {
  background: #475569;
  transform: scale(1.05);
}

.control-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Transcript Card */
.transcript-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.transcript-card h3 {
  font-size: 1.3rem;
  color: #1e293b;
  margin-bottom: 1.5rem;
}

.transcript-info {
  background: #f8fafc;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.transcript-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.transcript-status-row .label {
  font-weight: 600;
  color: #64748b;
}

.transcript-badge {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.transcript-badge.original,
.transcript-badge.none {
  background: #fef2f2;
  color: #dc2626;
  border: 2px solid #fecaca;
}

.transcript-badge.adjusted {
  background: #fef3c7;
  color: #d97706;
  border: 2px solid #fde68a;
}

.transcript-badge.retranscribed {
  background: #dcfce7;
  color: #16a34a;
  border: 2px solid #86efac;
}

.transcript-warning {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  padding: 1rem;
  border-radius: 4px;
  margin-top: 1rem;
}

.transcript-warning.error {
  background: #fef2f2;
  border-left: 4px solid #dc2626;
}

.transcript-warning p {
  margin: 0.25rem 0;
  color: #78350f;
  font-size: 0.9rem;
}

.transcript-warning.error p {
  color: #991b1b;
}

.transcript-success {
  background: #dcfce7;
  border-left: 4px solid #16a34a;
  padding: 1rem;
  border-radius: 4px;
  margin-top: 1rem;
}

.transcript-success p {
  margin: 0.25rem 0;
  color: #14532d;
  font-size: 0.9rem;
}

.transcript-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.retranscribe-button {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.retranscribe-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.retranscribe-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.transcript-hint {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0;
  font-style: italic;
}

.spinner-small {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Download Section */
.download-section {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.download-button {
  padding: 1rem 3rem;
  background: #16a34a;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 6px rgba(22, 163, 74, 0.2);
  max-width: 400px;
  width: auto;
  display: inline-block;
}

.download-button:hover {
  background: #15803d;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(22, 163, 74, 0.3);
}

.download-info {
  margin-top: 1rem;
  color: #64748b;
  font-size: 0.9rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.5rem;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: #64748b;
  font-size: 1rem;
  margin: 0;
}

/* Processing State */
.processing-state {
  margin-bottom: 2rem;
}

.loading-card {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 2px solid #93c5fd;
  border-radius: 12px;
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid #bfdbfe;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}

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

.loading-content {
  flex: 1 1;
}

.loading-content h3 {
  font-size: 1.5rem;
  color: #1e40af;
  margin: 0 0 0.5rem 0;
}

.processing-filename {
  font-size: 1.1rem;
  color: #1e293b;
  margin: 0.5rem 0;
}

.processing-details {
  font-size: 1rem;
  color: #3b82f6;
  margin: 0.5rem 0;
  font-weight: 500;
}

.processing-info {
  font-size: 0.9rem;
  color: #64748b;
  margin: 0.5rem 0 0 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .control-buttons {
    flex-direction: column;
  }
  
  .control-btn {
    width: 100%;
    justify-content: center;
  }
}
/* Pending Deletions Review */
.pending-deletions-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  border-left: 4px solid #f59e0b;
}

.pending-deletions-card h3 {
  font-size: 1.5rem;
  color: #1e293b;
  margin-bottom: 1rem;
}

.deletion-summary {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.deletion-summary p {
  margin: 0.5rem 0;
  font-size: 1rem;
}

.deletion-warning {
  color: #b45309;
  font-weight: 600;
  margin-top: 1rem !important;
  padding-top: 1rem;
  border-top: 1px solid #fcd34d;
}

.deletion-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.confirm-deletion-button {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.confirm-deletion-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
}

.confirm-deletion-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.reset-button {
  background: #6b7280;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  max-width: 300px;
  width: auto;
  display: inline-block;
}

.reset-button:hover:not(:disabled) {
  background: #4b5563;
  transform: translateY(-2px);
}

.reset-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.reset-button.secondary {
  background: #64748b;
  margin-left: 0;
}

.deletion-preview {
  background: #f8fafc;
  border-radius: 8px;
  padding: 1rem;
  max-height: 400px;
  overflow-y: auto;
}

.deletion-preview h4 {
  font-size: 1rem;
  color: #475569;
  margin: 0 0 1rem 0;
  font-weight: 600;
}

.segments-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.segment-preview {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.75rem;
  display: flex;
  gap: 1rem;
  align-items: start;
  transition: border-color 0.2s;
}

.segment-preview:hover {
  border-color: #cbd5e1;
}

.segment-time {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: #3b82f6;
  font-weight: 600;
  min-width: 100px;
}

.segment-text {
  font-size: 0.9rem;
  color: #64748b;
  flex: 1 1;
  line-height: 1.4;
}

.more-segments {
  text-align: center;
  color: #94a3b8;
  font-style: italic;
  margin: 0.5rem 0 0 0;
  font-size: 0.9rem;
}
/* Client-Processed Files */
.client-processed-notice {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
 border: 2px solid #60a5fa;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.client-processed-notice h3 {
  color: #1e40af;
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
}

.client-processed-notice p {
  color: #1e40af;
  margin: 0;
  line-height: 1.6;
}

.download-card.client-download {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.download-card.client-download h3 {
  color: #1e293b;
  margin: 0 0 1rem 0;
}

.download-card.client-download p {
  color: #64748b;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.download-card.client-download .download-button.primary {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 0.875rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
}

.download-card.client-download .download-button.primary:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.download-card.client-download .download-hint {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: #64748b;
  background: #f8fafc;
  padding: 0.75rem;
  border-radius: 6px;
}

.tab4-review {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.review-header {
  margin-bottom: 30px;
}

.review-header h2 {
  font-size: 24px;
  margin-bottom: 10px;
  color: #333;
}

.review-description {
  color: #666;
  font-size: 14px;
  line-height: 1.5;
}

.loading-state,
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #4a9eff;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.empty-state h3 {
  color: #666;
  margin-bottom: 10px;
}

.empty-state p {
  color: #999;
}

.error-message {
  background-color: #fee;
  border: 1px solid #fcc;
  color: #c33;
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 20px;
}

/* Project Statistics */
.tab4-project-statistics {
  margin-bottom: 30px;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 8px;
}

.tab4-project-statistics h3 {
  font-size: 18px;
  margin-bottom: 15px;
  color: #333;
}

.tab4-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  grid-gap: 15px;
  gap: 15px;
}

.tab4-stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 15px;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab4-stat-card:nth-child(2) {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.tab4-stat-card:nth-child(3) {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.tab4-stat-card:nth-child(4) {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.tab4-stat-card:nth-child(5) {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.tab4-stat-card:nth-child(6) {
  background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.tab4-stat-label {
  font-size: 10px;
  opacity: 1;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #000000;
  font-weight: 700;
}

.tab4-stat-value {
  font-size: 28px;
  font-weight: bold;
  color: #000000;
}

.tab4-stat-value.success {
  color: #fff;
}

/* File Comparison Table */
.tab4-files-comparison {
  margin-bottom: 30px;
}

.tab4-files-comparison h3 {
  font-size: 18px;
  margin-bottom: 15px;
  color: #333;
}

.tab4-comparison-table {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab4-table-header,
.tab4-table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr 0.8fr 1fr 1fr;
  grid-gap: 10px;
  gap: 10px;
  padding: 12px 15px;
  align-items: center;
}

.tab4-table-header {
  background: #f0f0f0;
  font-weight: 600;
  font-size: 13px;
  color: #555;
  border-bottom: 2px solid #ddd;
}

.tab4-table-row {
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: all 0.2s;
}

.tab4-table-row:hover {
  background: #f9f9f9;
}

.tab4-table-row.selected {
  background: #e3f2fd;
  border-left: 4px solid #2196f3;
}

.tab4-col-filename {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.tab4-file-icon {
  font-size: 18px;
}

.tab4-col-saved {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tab4-col-saved.success {
  color: #4caf50;
  font-weight: 600;
}

.tab4-percentage {
  font-size: 11px;
  color: #666;
  font-weight: normal;
}

.tab4-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.tab4-badge.reviewed {
  background: #e3f2fd;
  color: #2196f3;
}

.tab4-badge.approved {
  background: #e8f5e9;
  color: #4caf50;
}

.tab4-badge.pending {
  background: #fff3e0;
  color: #f57c00;
}

.tab4-btn-review {
  padding: 6px 12px;
  background: #4a9eff;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.tab4-btn-review:hover {
  background: #3a8eef;
}

/* File Details */
.tab4-file-details {
  padding: 20px;
  background: #f9f9f9;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
}

.tab4-file-details h3 {
  font-size: 18px;
  margin-bottom: 15px;
  color: #333;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .tab4-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .tab4-table-header,
  .tab4-table-row {
    grid-template-columns: 2fr 1fr 1fr 1fr 0.8fr 1fr 1fr;
    font-size: 12px;
  }
}

@media (max-width: 768px) {
  .tab4-review {
    padding: 15px;
  }
  
  .tab4-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .tab4-comparison-table {
    overflow-x: auto;
  }
  
  .tab4-table-header,
  .tab4-table-row {
    grid-template-columns: 200px 100px 100px 100px 80px 100px 120px;
    font-size: 11px;
  }
}

/* PreciseComparisonDisplay.css */

.precise-comparison-display {
  background: #f8fafc;
  border-radius: 12px;
  padding: 0;
  max-width: 1400px;
  margin: 0 auto;
}

/* Statistics Panel */
.statistics-panel {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
  border-radius: 12px 12px 0 0;
  margin-bottom: 0;
}

.panel-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  grid-gap: 1.5rem;
  gap: 1.5rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.15);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s;
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: white;
}

.stat-label {
  font-size: 0.95rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Filter Controls */
.filter-controls {
  background: white;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 2px solid #e5e7eb;
}

.filter-label {
  font-weight: 600;
  color: #475569;
  font-size: 1rem;
}

.filter-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.6rem 1.2rem;
  border: 2px solid #cbd5e1;
  background: white;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
  color: #475569;
}

.filter-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.filter-btn.active {
  background: #1e293b;
  color: white;
  border-color: #1e293b;
}

.filter-btn.matched.active {
  background: #10b981;
  border-color: #10b981;
}

.filter-btn.abnormal.active {
  background: #f59e0b;
  border-color: #f59e0b;
}

.filter-btn.missing.active {
  background: #ef4444;
  border-color: #ef4444;
}

.filter-btn.extra.active {
  background: #3b82f6;
  border-color: #3b82f6;
}

/* Regions Container */
.regions-container {
  background: white;
  padding: 2rem;
  border-radius: 0 0 12px 12px;
}

/* Region Sections */
.region-section {
  margin-bottom: 2.5rem;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #1e293b;
}

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

.matched-section .section-icon {
  color: #10b981;
}

.abnormal-section .section-icon {
  color: #f59e0b;
}

.missing-section .section-icon {
  color: #ef4444;
}

.extra-section .section-icon {
  color: #3b82f6;
}

.section-description {
  color: #64748b;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  font-style: italic;
}

/* Regions List */
.regions-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Region Cards */
.region-card {
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  background: white;
  overflow: hidden;
  transition: all 0.3s;
}

.region-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.matched-card {
  border-left: 5px solid #10b981;
}

.abnormal-card {
  border-left: 5px solid #f59e0b;
}

.missing-card {
  border-left: 5px solid #ef4444;
}

.extra-card {
  border-left: 5px solid #3b82f6;
}

/* Region Header */
.region-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  background: #f8fafc;
  transition: background 0.2s;
}

.region-header:hover {
  background: #f1f5f9;
}

.region-title {
  flex: 1 1;
  font-weight: 600;
  color: #1e293b;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.word-count {
  background: #e0e7ff;
  color: #4338ca;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.reason-badge {
  background: #fed7aa;
  color: #92400e;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.region-time {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.time-badge {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.time-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(79, 70, 229, 0.4);
}

.time-badge:active {
  transform: translateY(0);
}

.time-badge.small {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

.time-separator {
  color: #94a3b8;
  font-weight: 700;
}

.expand-icon {
  color: #64748b;
  font-size: 1.2rem;
  transition: transform 0.2s;
  -webkit-user-select: none;
          user-select: none;
}

/* Region Content */
.region-content {
  padding: 1.5rem;
  border-top: 1px solid #e5e7eb;
  background: white;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 1000px;
  }
}

.content-text {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #334155;
  font-family: 'Georgia', serif;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin-bottom: 1rem;
}

.segments-info {
  background: #ede9fe;
  color: #5b21b6;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: 'Courier New', monospace;
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: #94a3b8;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state-text {
  font-size: 1.1rem;
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
  .statistics-panel {
    padding: 1.5rem;
  }
  
  .panel-title {
    font-size: 1.4rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .stat-value {
    font-size: 2rem;
  }
  
  .filter-controls {
    padding: 1rem;
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-buttons {
    flex-direction: column;
  }
  
  .filter-btn {
    width: 100%;
  }
  
  .regions-container {
    padding: 1rem;
  }
  
  .region-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 1rem;
  }
  
  .region-time {
    justify-content: space-between;
  }
  
  .region-content {
    padding: 1rem;
  }
}

/* Print Styles */
@media print {
  .filter-controls {
    display: none;
  }
  
  .region-card {
    page-break-inside: avoid;
  }
  
  .time-badge {
    background: #e5e7eb !important;
    color: #1e293b !important;
  }
}

.project-detail-page-new {
  min-height: 100vh;
  background: #f9fafb;
}

.loading-container,
.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 1.5rem;
  background: #f9fafb;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 5px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-container p,
.error-container p {
  font-size: 1.125rem;
  color: #6b7280;
  font-weight: 500;
}

.error-container button {
  padding: 0.875rem 2rem;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.error-container button:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

/* Project Header */
.project-header {
  background: white;
  padding: 2rem 2.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #e5e7eb;
}

.back-button {
  background: transparent;
  border: none;
  color: #2563eb;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.5rem 0;
  margin-bottom: 1.25rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.back-button:hover {
  color: #1d4ed8;
  transform: translateX(-4px);
}

.project-title-section {
  margin-bottom: 1.25rem;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.project-title-section h1 {
  margin: 0 0 0.75rem 0;
  font-size: 2.25rem;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.025em;
}

.project-description {
  margin: 0;
  color: #6b7280;
  font-size: 1.05rem;
  line-height: 1.6;
}

.project-info {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.info-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 1.25rem;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

.info-badge.success {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #166534;
}

/* Tab Content */
.tab-content {
  min-height: 600px;
  background: #f9fafb;
}

/* Responsive */
@media (max-width: 768px) {
  .project-header {
    padding: 1rem;
  }

  .project-title-section h1 {
    font-size: 1.5rem;
  }

  .project-info {
    flex-direction: column;
    gap: 0.5rem;
  }
}

.debug-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.debug-toggle-btn {
  background: #2196F3;
  color: white;
  border: none;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
  transition: all 0.3s ease;
}

.debug-toggle-btn:hover {
  background: #1976D2;
  transform: translateY(-2px);
}

.debug-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 450px;
  max-height: 600px;
  background: white;
  border: 2px solid #2196F3;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.debug-header {
  background: #2196F3;
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.debug-header h3 {
  margin: 0;
  font-size: 16px;
}

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

.debug-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
}

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

.debug-btn.close {
  background: rgba(244, 67, 54, 0.8);
}

.debug-btn.close:hover {
  background: rgba(244, 67, 54, 1);
}

.system-status {
  padding: 15px 20px;
  border-bottom: 1px solid #e0e0e0;
}

.system-status h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #333;
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 10px;
  gap: 10px;
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  background: #f5f5f5;
  border-radius: 6px;
  font-size: 12px;
}

.status-label {
  font-weight: bold;
  color: #666;
}

.status-indicator {
  font-weight: bold;
  text-transform: uppercase;
}

.status-value {
  color: #666;
  font-family: monospace;
}

.debug-logs {
  flex: 1 1;
  padding: 15px 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.debug-logs h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #333;
}

.logs-container {
  flex: 1 1;
  overflow-y: auto;
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 10px;
}

.no-logs {
  text-align: center;
  color: #999;
  font-style: italic;
  padding: 20px;
}

.log-entry {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 4px;
  margin-bottom: 6px;
  font-size: 12px;
  line-height: 1.4;
  border-left: 3px solid #ddd;
}

.log-entry.log-error {
  background: #ffebee;
  border-left-color: #f44336;
}

.log-entry.log-api-call {
  background: #e3f2fd;
  border-left-color: #2196F3;
}

.log-entry.log-api-response {
  background: #e8f5e8;
  border-left-color: #4CAF50;
}

.log-entry.log-system {
  background: #fff3e0;
  border-left-color: #FF9800;
}

.log-entry.log-info {
  background: #f3e5f5;
  border-left-color: #9C27B0;
}

.log-time {
  color: #666;
  font-family: monospace;
  font-size: 11px;
  min-width: 60px;
}

.log-icon {
  font-size: 14px;
}

.log-message {
  flex: 1 1;
  font-weight: 500;
}

.log-data {
  width: 100%;
  margin-top: 6px;
}

.log-data summary {
  cursor: pointer;
  font-size: 11px;
  color: #666;
  padding: 2px 0;
}

.log-data pre {
  background: rgba(0, 0, 0, 0.05);
  padding: 8px;
  border-radius: 4px;
  font-size: 10px;
  overflow-x: auto;
  margin: 4px 0 0 0;
  max-height: 150px;
  overflow-y: auto;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
  .debug-panel {
    width: calc(100vw - 40px);
    max-height: 70vh;
    bottom: 10px;
    right: 10px;
    left: 10px;
  }
  
  .status-grid {
    grid-template-columns: 1fr;
  }
}
/* ProjectDetailPage.css */

.project-detail-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  margin-top: 100px; /* Account for fixed header */
}

.project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.back-btn {
  background: #f0f0f0;
  border: none;
  padding: 10px 15px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  color: #333;
  transition: all 0.3s ease;
}

.back-btn:hover {
  background: #ddd;
  transform: translateX(-2px);
}

.project-header h1 {
  color: #333;
  font-size: 2.2em;
  margin: 0;
}

.delete-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9em;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.delete-btn:hover:not(:disabled) {
  background: #c82333;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.delete-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
  opacity: 0.7;
}

.danger-btn {
  border: 2px solid #dc3545;
}

.danger-btn:hover:not(:disabled) {
  border-color: #c82333;
}

.header-badges {
  display: flex;
  gap: 10px;
  align-items: center;
}

.status-badge {
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.9em;
  text-transform: uppercase;
}

.infra-badge {
  padding: 6px 12px;
  border-radius: 15px;
  font-weight: bold;
  font-size: 0.8em;
  border: 2px solid;
}

.infra-badge.running {
  background: #e8f5e8;
  color: #2e7d32;
  border-color: #4caf50;
}

.infra-badge.stopped {
  background: #ffebee;
  color: #c62828;
  border-color: #f44336;
}

.task-count {
  font-size: 0.9em;
  font-weight: normal;
}

.status-badge.pending {
  background: #FFF3E0;
  color: #F57C00;
}

.status-badge.processing {
  background: #E3F2FD;
  color: #1976D2;
}

.status-badge.completed {
  background: #E8F5E8;
  color: #2E7D32;
}

.status-badge.failed {
  background: #FFEBEE;
  color: #C62828;
}

/* Upload Section */
.upload-section {
  background: white;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.upload-section h2 {
  color: #333;
  margin: 0 0 20px 0;
  font-size: 1.6em;
}

.file-uploads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  grid-gap: 20px;
  gap: 20px;
}

.file-upload-card {
  background: #f9f9f9;
  border: 2px dashed #ddd;
  border-radius: 12px;
  padding: 25px;
  text-align: center;
  transition: all 0.3s ease;
}

.file-upload-card:hover {
  border-color: #4CAF50;
  background: #f8fff8;
}

.file-icon {
  font-size: 3em;
  margin-bottom: 15px;
}

.file-upload-card h3 {
  color: #333;
  margin: 0 0 10px 0;
}

.file-upload-card p {
  color: #666;
  margin: 0 0 20px 0;
  font-size: 0.95em;
}

.upload-btn {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.upload-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #45a049, #4CAF50);
  transform: translateY(-2px);
}

.upload-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.file-uploaded {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #2E7D32;
  font-weight: bold;
}

.success-icon {
  font-size: 1.2em;
  color: #4CAF50;
}

/* Processing Section */
.processing-section {
  background: white;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.processing-section h2 {
  color: #333;
  margin: 0 0 20px 0;
  font-size: 1.6em;
}

.ready-to-process {
  text-align: center;
  padding: 20px;
  background: #f0f8ff;
  border-radius: 8px;
  border: 2px solid #4CAF50;
}

.ready-to-process p {
  color: #2E7D32;
  font-weight: bold;
  margin: 0 0 15px 0;
  font-size: 1.1em;
}

.process-btn {
  background: linear-gradient(135deg, #2196F3, #1976D2);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.process-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #1976D2, #2196F3);
  transform: translateY(-2px);
}

.process-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.processing-indicator {
  text-align: center;
  padding: 20px;
}

.progress-bar {
  background: #e0e0e0;
  border-radius: 10px;
  height: 20px;
  overflow: hidden;
  margin-bottom: 15px;
  position: relative;
}

.progress-fill {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  height: 100%;
  border-radius: 10px;
  transition: width 0.5s ease;
  animation: shimmer 1.5s infinite;
}

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

.progress-text {
  color: #333;
  font-weight: bold;
  margin: 0;
}

.error-message {
  text-align: center;
  padding: 20px;
  background: #ffebee;
  border-radius: 8px;
  border: 2px solid #f44336;
}

.error-message p {
  color: #c62828;
  font-weight: bold;
  margin: 0 0 15px 0;
}

.retry-btn {
  background: #f44336;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

.retry-btn:hover {
  background: #d32f2f;
}

/* Transcribing status container */
.transcribing-actions {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px;
  background: #fff3e0;
  border-radius: 8px;
  border: 1px solid #ffcc02;
}

.restart-btn {
  background: #ff9800;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 12px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.restart-btn:hover {
  background: #f57c00;
  transform: translateY(-1px);
}

.restart-btn:active {
  transform: translateY(0);
}

/* Results Section */
.results-section {
  background: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.results-section h2 {
  color: #333;
  margin: 0 0 20px 0;
  font-size: 1.6em;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  grid-gap: 20px;
  gap: 20px;
  margin-bottom: 30px;
}

.result-card {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 20px;
  border-left: 4px solid #4CAF50;
}

.result-card h3 {
  color: #333;
  margin: 0 0 15px 0;
}

.pdf-section {
  background: white;
  padding: 15px;
  border-radius: 6px;
  border: 1px solid #ddd;
  max-height: 200px;
  overflow-y: auto;
}

.pdf-section p {
  margin: 0;
  color: #444;
  font-family: monospace;
  font-size: 0.9em;
  line-height: 1.4;
}

.summary-stats {
  display: flex;
  justify-content: space-around;
  gap: 20px;
}

.stat {
  text-align: center;
  background: white;
  padding: 15px;
  border-radius: 6px;
  border: 1px solid #ddd;
}

.stat-number {
  display: block;
  font-size: 2em;
  font-weight: bold;
  color: #4CAF50;
}

.stat-label {
  display: block;
  font-size: 0.9em;
  color: #666;
  margin-top: 5px;
}

.download-card {
  border-left-color: #2196F3;
  text-align: center;
}

.download-btn {
  background: linear-gradient(135deg, #2196F3, #1976D2);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.download-btn:hover {
  background: linear-gradient(135deg, #1976D2, #2196F3);
  transform: translateY(-2px);
}

/* Segments Section */
.segments-section {
  margin-top: 30px;
  border-top: 2px solid #e0e0e0;
  padding-top: 20px;
}

.segments-section h3 {
  color: #333;
  margin-bottom: 15px;
}

.segments-list {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.segment-item {
  padding: 15px;
  border-bottom: 1px solid #eee;
  transition: all 0.3s ease;
}

.segment-item:last-child {
  border-bottom: none;
}

.segment-item.kept {
  background: #f8fff8;
  border-left: 4px solid #4CAF50;
}

.segment-item.duplicate {
  background: #fff8f8;
  border-left: 4px solid #f44336;
  opacity: 0.7;
}

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

.segment-time {
  color: #666;
  font-size: 0.85em;
  font-family: monospace;
}

.segment-status {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: bold;
}

.segment-status.kept {
  background: #E8F5E8;
  color: #2E7D32;
}

.segment-status.removed {
  background: #FFEBEE;
  color: #C62828;
}

.segment-text {
  color: #333;
  line-height: 1.4;
}

/* Loading States */
.loading-container, .error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #4CAF50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .project-detail-page {
    padding: 15px;
    margin-top: 80px;
  }

  .project-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .file-uploads {
    grid-template-columns: 1fr;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .summary-stats {
    flex-direction: column;
    gap: 10px;
  }

  .segment-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
}

/* Audio Files List Styles */
.audio-files-section {
  margin-top: 30px;
  padding: 20px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  background: #f9f9f9;
}

.audio-files-section h3 {
  margin-bottom: 20px;
  color: #333;
  font-size: 1.4em;
}

.audio-files-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.audio-file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: white;
  border-radius: 8px;
  border: 1px solid #ddd;
  transition: all 0.3s ease;
}

.audio-file-item:hover {
  border-color: #4CAF50;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.1);
}

.audio-file-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.audio-file-name {
  font-weight: bold;
  color: #333;
  font-size: 1.1em;
}

.audio-file-status {
  font-size: 0.9em;
  padding: 4px 8px;
  border-radius: 12px;
  display: inline-block;
  width: -webkit-fit-content;
  width: fit-content;
}

.audio-file-status.pending {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.audio-file-status.processing {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.audio-file-status.completed {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.audio-file-status.failed {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.audio-file-actions {
  display: flex;
  gap: 10px;
}

.transcribe-audio-btn {
  background: #FF9800;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  margin-right: 5px;
}

.transcribe-audio-btn:hover {
  background: #F57C00;
  transform: translateY(-1px);
}

.process-audio-btn {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.process-audio-btn:hover {
  background: #45a049;
  transform: translateY(-1px);
}

.download-btn {
  background: #2196F3;
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: bold;
  transition: all 0.3s ease;
  display: inline-block;
}

.download-btn:hover {
  background: #1976D2;
  transform: translateY(-1px);
  color: white;
  text-decoration: none;
}

.add-more-audio {
  border-top: 1px solid #ddd;
  padding-top: 15px;
}

.upload-btn.secondary {
  background: #f0f0f0;
  color: #333;
  border: 2px solid #ddd;
}

.upload-btn.secondary:hover {
  background: #e0e0e0;
  border-color: #bbb;
}

.audio-files-loading {
  text-align: center;
  padding: 20px;
  color: #666;
  font-style: italic;
}

.status-text {
  font-weight: bold;
  padding: 8px 12px;
  border-radius: 6px;
  display: inline-block;
  background: #e3f2fd;
  color: #1976d2;
  border: 1px solid #bbdefb;
}

.status-text.error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}

.failed-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.retry-btn {
  background: #f44336;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: bold;
  transition: all 0.3s ease;
}

.retry-btn:hover {
  background: #d32f2f;
  transform: translateY(-1px);
}

.audio-file-status.transcribing {
  background: #fff8e1;
  color: #f57c00;
  border: 1px solid #ffcc02;
}

.audio-file-status.transcribed {
  background: #e8f5e8;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

/* Transcript Display Styles */
.transcript-display {
  margin-top: 20px;
  padding: 20px;
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.transcript-display h4 {
  color: #333;
  margin-bottom: 15px;
  font-size: 1.2em;
}

.transcript-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
  padding: 10px;
  background: #e3f2fd;
  border-radius: 4px;
}

.transcript-stats p {
  margin: 0;
  color: #1976d2;
  font-weight: 500;
}

.transcript-content {
  max-height: 400px;
  overflow-y: auto;
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 15px;
}

.transcript-content pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.6;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 14px;
  margin: 0;
  color: #333;
}

/* Delete Audio File Button */
.delete-audio-btn {
  background: #f44336;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: bold;
  transition: all 0.3s ease;
  margin-left: 8px;
}

.delete-audio-btn:hover {
  background: #d32f2f;
  transform: translateY(-1px);
}

.delete-audio-btn:active {
  transform: translateY(0);
}

/* ========================= NEW STEP-BY-STEP WORKFLOW STYLES ========================= */

/* Sub-steps styling */
.sub-step {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  margin: 15px 0;
}

.sub-step h4 {
  color: #495057;
  margin: 0 0 10px 0;
  font-size: 1.1em;
}

/* PDF Matching styles */
.pdf-matching, .pdf-match-complete {
  padding: 15px;
}

.match-pdf-btn {
  background: #17a2b8;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.match-pdf-btn:hover {
  background: #138496;
  transform: translateY(-1px);
}

.match-results {
  background: #d1ecf1;
  border: 1px solid #bee5eb;
  border-radius: 4px;
  padding: 10px;
  margin-top: 10px;
}

/* Duplicate Detection styles */
.duplicate-detection, .duplicates-detected {
  padding: 15px;
}

.detect-duplicates-btn {
  background: #ffc107;
  color: #212529;
  border: none;
  padding: 12px 20px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.detect-duplicates-btn:hover {
  background: #e0a800;
  transform: translateY(-1px);
}

.duplicate-summary {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 4px;
  padding: 10px;
  margin-top: 10px;
}

/* Review Duplicates styles */
.duplicate-review {
  padding: 15px;
}

.review-duplicates-btn {
  background: #6f42c1;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.review-duplicates-btn:hover {
  background: #5a32a3;
  transform: translateY(-1px);
}

/* ========================= DUPLICATE REVIEW COMPONENT STYLES ========================= */

.duplicate-review-container {
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
  max-width: 100%; /* Full width */
  width: 100%;
}

.review-header {
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.review-header h4 {
  color: #495057;
  margin: 0 0 10px 0;
}

.selection-summary {
  background: #e7f3ff;
  border: 1px solid #b8daff;
  border-radius: 4px;
  padding: 10px;
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.selection-summary p {
  margin: 0;
}

.toggle-transcript-btn {
  background: linear-gradient(135deg, #0288d1, #0277bd);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.toggle-transcript-btn:hover {
  background: linear-gradient(135deg, #0277bd, #01579b);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(2, 136, 209, 0.3);
}

/* Transcript with Highlights */
.transcript-with-highlights {
  background: #f8f9fa;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  padding: 20px;
  margin: 20px 0;
}

.transcript-loading {
  background: #f8f9fa;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  padding: 20px;
  margin: 20px 0;
  text-align: center;
  color: #6c757d;
  font-style: italic;
}

.transcript-with-highlights h5 {
  margin: 0 0 15px 0;
  color: #495057;
}

.transcript-content-highlighted {
  background: white;
  padding: 15px;
  border-radius: 4px;
  line-height: 1.8;
  font-size: 15px;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.transcript-segment {
  padding: 2px 4px;
  border-radius: 3px;
  transition: all 0.2s ease;
  cursor: help;
}

.transcript-segment.segment-duplicate {
  background: rgba(220, 53, 69, 0.15);
  border-bottom: 2px solid #dc3545;
  color: #721c24;
  font-weight: 500;
}

.transcript-segment.segment-kept {
  background: rgba(40, 167, 69, 0.15);
  border-bottom: 2px solid #28a745;
  color: #155724;
  font-weight: 500;
}

.transcript-segment:hover {
  background: rgba(0, 123, 255, 0.1);
  transform: scale(1.02);
}

.transcript-segment.segment-highlighted {
  background: rgba(255, 193, 7, 0.4) !important;
  border: 2px solid #ffc107;
  padding: 3px 6px;
  animation: pulse-highlight 1s ease-in-out;
}

@keyframes pulse-highlight {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7); }
  50% { box-shadow: 0 0 0 10px rgba(255, 193, 7, 0); }
}

.transcript-legend {
  margin-top: 15px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding: 10px;
  background: white;
  border-radius: 4px;
  border: 1px solid #dee2e6;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #495057;
}

.legend-box {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  border: 1px solid #dee2e6;
  display: inline-block;
}

.legend-box.segment-duplicate {
  background: rgba(220, 53, 69, 0.15);
  border-bottom: 3px solid #dc3545;
}

.legend-box.segment-kept {
  background: rgba(40, 167, 69, 0.15);
  border-bottom: 3px solid #28a745;
}

.duplicate-groups {
  max-height: 600px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.duplicate-group {
  border: 1px solid #dee2e6;
  border-radius: 6px;
  margin-bottom: 20px;
  overflow: hidden;
}

.group-header {
  background: #f8f9fa;
  padding: 15px;
  border-bottom: 1px solid #dee2e6;
  transition: all 0.3s ease;
}

.group-header:hover {
  background: #e9ecef;
}

.expand-icon {
  font-size: 12px;
  color: #6c757d;
  transition: transform 0.3s ease;
}

.group-header h5 {
  margin: 0 0 10px 0;
  color: #495057;
}

.group-occurrences {
  padding: 10px;
}

.occurrence {
  border: 1px solid #e9ecef;
  border-radius: 4px;
  margin-bottom: 10px;
  padding: 15px;
  background: #fefefe;
}

.occurrence.last-occurrence {
  background: #d4edda;
  border-color: #c3e6cb;
}

.occurrence.occurrence-highlighted {
  background: #fff3cd !important;
  border: 3px solid #ffc107 !important;
  box-shadow: 0 0 15px rgba(255, 193, 7, 0.5);
  animation: pulse-occurrence 1s ease-in-out;
}

@keyframes pulse-occurrence {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.occurrence-header {
  margin-bottom: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: bold;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.occurrence-title {
  color: #495057;
}

.occurrence-details {
  margin-left: 28px;
}

.occurrence-details p {
  margin: 5px 0;
  color: #6c757d;
}

.action-badge {
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: bold;
  font-size: 0.85em;
}

.action-badge.keep {
  background: #d4edda;
  color: #155724;
}

.action-badge.delete {
  background: #f8d7da;
  color: #721c24;
}

/* Mini Waveform Styles */
.waveform-section {
  margin-top: 15px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #dee2e6;
}

.mini-waveform-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.load-waveform-btn {
  flex: 1 1;
  padding: 8px 12px;
  background: linear-gradient(135deg, #e9ecef, #dee2e6);
  border: 1px solid #ced4da;
  border-radius: 4px;
  color: #495057;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.3s ease;
}

.load-waveform-btn:hover {
  background: linear-gradient(135deg, #dee2e6, #ced4da);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mini-waveform {
  flex: 1 1;
  border-radius: 4px;
  overflow: hidden;
  background: white;
}

.mini-waveform-error {
  flex: 1 1;
  padding: 10px;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  color: #721c24;
  font-size: 12px;
  text-align: center;
}

.mini-play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6f42c1, #9b59b6);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.mini-play-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #5a32a3, #8e44ad);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(111, 66, 193, 0.4);
}

.mini-play-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

.mini-play-btn.playing {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.mini-play-btn.playing:hover {
  background: linear-gradient(135deg, #c0392b, #a93226);
}

.audio-controls {
  margin-top: 10px;
}

.play-segment-btn {
  background: #28a745;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.3s ease;
}

.play-segment-btn:hover {
  background: #218838;
  transform: translateY(-1px);
}

.review-actions {
  border-top: 1px solid #e9ecef;
  padding-top: 20px;
  text-align: center;
}

.confirm-deletions-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 1.1em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.confirm-deletions-btn:hover:not(:disabled) {
  background: #c82333;
  transform: translateY(-1px);
}

.confirm-deletions-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
}

/* ========================= PDF MATCH COMPARISON STYLES ========================= */

.pdf-match-comparison {
  background: white;
  border: 2px solid #17a2b8;
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
}

.comparison-header {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e9ecef;
}

.comparison-header h4 {
  color: #17a2b8;
  margin: 0 0 10px 0;
}

.match-confidence {
  margin-top: 10px;
}

.confidence-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.9em;
}

.confidence-badge.high {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.confidence-badge.low {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.text-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 20px;
  gap: 20px;
  margin-bottom: 20px;
}

.text-panel {
  border: 1px solid #dee2e6;
  border-radius: 6px;
  overflow: hidden;
}

.text-panel h5 {
  background: #f8f9fa;
  padding: 10px 15px;
  margin: 0;
  color: #495057;
  border-bottom: 1px solid #dee2e6;
}

.pdf-panel h5 {
  background: #e7f3ff;
  color: #0056b3;
}

.transcript-panel h5 {
  background: #f0fff4;
  color: #006400;
}

.text-content {
  padding: 15px;
  max-height: 400px;
  overflow-y: auto;
  line-height: 1.6;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 0.95em;
}

.pdf-content {
  background: #fafbfc;
}

.transcript-content {
  background: #f9fffe;
}

/* Highlighting for matched phrases */
.highlight-reference {
  background: #ffeb3b !important;
  padding: 1px 3px;
  border-radius: 2px;
  font-weight: bold;
}

.highlight-match {
  background: #4caf50 !important;
  color: white !important;
  padding: 1px 3px;
  border-radius: 2px;
  font-weight: bold;
}

.comparison-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid #e9ecef;
}

.toggle-text-btn {
  background: #6c757d;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.toggle-text-btn:hover {
  background: #5a6268;
}

.match-actions {
  display: flex;
  gap: 15px;
}

.reject-match-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.reject-match-btn:hover {
  background: #c82333;
  transform: translateY(-1px);
}

.confirm-match-btn {
  background: #28a745;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.confirm-match-btn:hover {
  background: #218838;
  transform: translateY(-1px);
}

.comparison-legend {
  margin-top: 15px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 4px;
  font-size: 0.85em;
  color: #6c757d;
}

.comparison-legend p {
  margin: 2px 0;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
  .text-comparison {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .comparison-controls {
    flex-direction: column;
    gap: 15px;
  }
  
  .match-actions {
    width: 100%;
    justify-content: center;
  }
}

/* Progress Bar for Background Tasks */
.progress-container {
  margin: 15px 0;
  display: flex;
  align-items: center;
  gap: 15px;
}

.progress-bar {
  flex: 1 1;
  height: 20px;
  background: #f0f0f0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #ddd;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #45a049);
  transition: width 0.3s ease;
  border-radius: 10px;
}

.progress-text {
  font-weight: bold;
  color: #333;
  min-width: 40px;
  text-align: right;
}

/* Enhanced processing status styles */
.processing-status {
  text-align: center;
  padding: 20px;
  background: #f8f9fa;
  border: 2px solid #e3f2fd;
  border-radius: 8px;
  margin: 15px 0;
}

.processing-status p {
  margin: 8px 0;
  color: #1976d2;
  font-weight: 500;
}

.processing-status em {
  color: #666;
  font-size: 0.9em;
}

/* Processing failed status */
.processing-failed {
  text-align: center;
  padding: 25px;
  background: #fff3cd;
  border: 2px solid #ffc107;
  border-radius: 8px;
  margin: 15px 0;
}

.processing-failed h4 {
  color: #d32f2f;
  margin-bottom: 12px;
  font-size: 1.3em;
}

.processing-failed .error-message {
  background: #ffffff;
  padding: 12px;
  border-radius: 6px;
  border-left: 4px solid #d32f2f;
  margin: 15px 0;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: #333;
  text-align: left;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.processing-failed .retry-btn {
  margin: 15px auto;
  display: inline-block;
  min-width: 200px;
}

.processing-failed .help-text {
  font-size: 0.85em;
  color: #666;
  margin-top: 10px;
  font-style: italic;
}

.loading-spinner {
  margin: 0 auto 15px;
  width: 30px;
  height: 30px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #1976d2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Action Button Styles */
.action-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95em;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.action-btn:active:not(:disabled) {
  transform: translateY(0);
}

.action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Primary Action Buttons (main actions) */
.btn-primary {
  background: linear-gradient(135deg, #1976d2, #1565c0);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #1565c0, #0d47a1);
}

/* Secondary Action Buttons (supporting actions) */
.btn-secondary {
  background: linear-gradient(135deg, #757575, #616161);
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: linear-gradient(135deg, #616161, #424242);
}

/* Info Buttons (view/display actions) */
.btn-info {
  background: linear-gradient(135deg, #0288d1, #0277bd);
  color: white;
}

.btn-info:hover:not(:disabled) {
  background: linear-gradient(135deg, #0277bd, #01579b);
}

/* Reset/Refresh Buttons */
.btn-reset {
  background: linear-gradient(135deg, #f57c00, #ef6c00);
  color: white;
}

.btn-reset:hover:not(:disabled) {
  background: linear-gradient(135deg, #ef6c00, #e65100);
}

/* Warning Buttons (restart/retry actions) */
.btn-warning {
  background: linear-gradient(135deg, #ff9800, #f57c00);
  color: white;
}

.btn-warning:hover:not(:disabled) {
  background: linear-gradient(135deg, #f57c00, #ef6c00);
}

/* Action Button Groups */
.action-buttons {
  display: flex;
  gap: 12px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.action-buttons .action-btn {
  flex: 0 1 auto;
}

/* PDF Boundary Refinement Styles */
.pdf-boundary-refinement {
  background: white;
  border-radius: 8px;
  padding: 30px;
  margin: 20px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
/* PDF Boundary Refinement Styles */
.pdf-boundary-refinement {
  background: white;
  border-radius: 8px;
  padding: 30px;
  margin: 20px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.refinement-header {
  text-align: center;
  margin-bottom: 30px;
}

.refinement-header h4 {
  font-size: 24px;
  color: #333;
  margin-bottom: 10px;
}

.refinement-header p {
  color: #666;
  font-size: 16px;
}

.boundary-info {
  display: flex;
  justify-content: space-around;
  margin-bottom: 30px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
}

.boundary-stat {
  text-align: center;
}

.boundary-stat .stat-label {
  display: block;
  font-size: 14px;
  color: #666;
  margin-bottom: 5px;
}

.boundary-stat .stat-value {
  display: block;
  font-size: 24px;
  font-weight: bold;
  color: #6f42c1;
}

.pdf-text-display {
  margin-bottom: 30px;
}

.pdf-text-display h5 {
  font-size: 18px;
  color: #333;
  margin-bottom: 15px;
}

.pdf-text-display .instruction {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 20px;
  color: #856404;
}

.text-segments {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.text-segment {
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 15px;
}

.text-segment.context-before {
  background: #f8f9fa;
  border-color: #dee2e6;
}

.text-segment.matched-section {
  background: #e7f3ff;
  border-color: #007bff;
}

.text-segment.context-after {
  background: #f8f9fa;
  border-color: #dee2e6;
}

.segment-label {
  font-weight: bold;
  color: #6f42c1;
  margin-bottom: 10px;
  padding: 5px 10px;
  background: rgba(111, 66, 193, 0.1);
  border-radius: 4px;
  display: inline-block;
}

.segment-text {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: #333;
}

.segment-text.selectable {
  width: 100%;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 15px;
  resize: vertical;
  min-height: 300px;
  font-family: 'Courier New', monospace;
  background: white;
}

.segment-text.selectable:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.selection-info {
  margin-top: 15px;
  padding: 15px;
  background: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 4px;
  text-align: center;
}

.selection-info p {
  margin: 0 0 10px 0;
  color: #155724;
  font-weight: bold;
}

.apply-selection-btn {
  background: #28a745;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
}

.apply-selection-btn:hover {
  background: #218838;
}

.refinement-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

.cancel-btn {
  background: #6c757d;
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
}

.cancel-btn:hover {
  background: #5a6268;
}

.cancel-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.save-boundaries-btn {
  background: #007bff;
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
}

.save-boundaries-btn:hover {
  background: #0056b3;
}

.save-boundaries-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.refine-boundaries-btn {
  background: #ffc107;
  color: #333;
  border: none;
  padding: 12px 30px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.refine-boundaries-btn:hover {
  background: #e0a800;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}


/* =================== STEP 4: VERIFICATION STYLES =================== */

.verification-step {
  margin-top: 30px;
  padding: 25px;
  background: #f9f9f9;
  border-radius: 12px;
  border: 2px solid #4CAF50;
}

.verification-results {
  margin-top: 20px;
}

.verification-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  grid-gap: 20px;
  gap: 20px;
  margin-bottom: 25px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-card h4 {
  margin: 0 0 10px 0;
  color: #666;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
}

.big-stat {
  font-size: 42px;
  font-weight: bold;
  color: #4CAF50;
  margin: 10px 0;
}

.stat-card p {
  margin: 5px 0 0 0;
  color: #999;
  font-size: 13px;
}

.warning-box {
  background: #fff3cd;
  border: 2px solid #ffc107;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
}

.warning-box h4 {
  margin-top: 0;
  color: #856404;
}

.warning-box ul {
  margin: 15px 0;
  padding-left: 25px;
}

.warning-box li {
  margin: 8px 0;
  color: #856404;
}

.comparison-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 20px;
  gap: 20px;
  margin: 25px 0;
}

.comparison-panel {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.comparison-panel h4 {
  margin-top: 0;
  color: #333;
  font-size: 16px;
  border-bottom: 2px solid #4CAF50;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.transcript-box {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 6px;
  max-height: 400px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #333;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.char-count {
  margin-top: 10px;
  color: #999;
  font-size: 12px;
  text-align: right;
}

.secondary-btn {
  background: #6c757d;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 20px;
}

.secondary-btn:hover {
  background: #5a6268;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

@media (max-width: 968px) {
  .comparison-panels {
    grid-template-columns: 1fr;
  }
  
  .verification-stats {
    grid-template-columns: 1fr;
  }
}


.error-text {
  color: #d32f2f;
  font-weight: 600;
  margin: 10px 0;
  padding: 10px;
  background: #ffebee;
  border-radius: 6px;
  border: 1px solid #ef5350;
}

.retry-btn {
  background: #ff9800;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 10px;
}

.retry-btn:hover {
  background: #f57c00;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}


/* =================== RETRY HISTORY SECTION =================== */

.retry-history-section {
  margin-top: 40px;
  padding: 25px;
  background: #f5f5f5;
  border-radius: 12px;
  border: 2px solid #ff9800;
}

.retry-history-section h3 {
  margin-top: 0;
  color: #333;
}

.history-card {
  background: white;
  padding: 20px;
  margin: 15px 0;
  border-radius: 8px;
  border-left: 4px solid #ff9800;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.history-header strong {
  color: #ff9800;
  font-size: 16px;
}

.history-header span {
  color: #999;
  font-size: 13px;
}

.history-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  grid-gap: 10px;
  gap: 10px;
}

.history-details p {
  margin: 5px 0;
  font-size: 14px;
  color: #666;
}

.history-details .error-text {
  grid-column: 1 / -1;
  margin-top: 10px;
}


/* =================== PDF WORD-BY-WORD VALIDATION SECTION =================== */

.pdf-validation-step {
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
  border: 2px solid #2196f3;
  padding: 30px;
  border-radius: 12px;
  margin-top: 30px;
}

.pdf-validation-step h3 {
  color: #1976d2;
  margin-bottom: 15px;
}

.validation-btn {
  background: linear-gradient(135deg, #2196f3, #1976d2);
  color: white;
  font-size: 16px;
  padding: 15px 30px;
  transition: all 0.3s ease;
}

.validation-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

/* Validation Progress */
.progress-section {
  margin: 20px 0;
}

.progress-bar-container {
  background: #e0e0e0;
  border-radius: 10px;
  height: 30px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #4caf50, #8bc34a);
  transition: width 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  animation: progressPulse 2s infinite;
}

@keyframes progressPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.progress-text {
  text-align: center;
  margin-top: 10px;
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

/* Validation Results */
.validation-results-container {
  margin-top: 25px;
}

.validation-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  grid-gap: 20px;
  gap: 20px;
  margin-bottom: 30px;
}

.validation-stats-grid .stat-card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-align: center;
}

.success-stat {
  color: #4caf50;
}

.error-stat {
  color: #f44336;
}

.warning-stat {
  color: #ff9800;
}

/* Validation Comparison Panels */
.validation-comparison-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 20px;
  gap: 20px;
  margin: 25px 0;
}

.validation-comparison-panel {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border: 2px solid #e0e0e0;
}

.pdf-validation-panel {
  border-color: #2196f3;
}

.transcript-validation-panel {
  border-color: #9c27b0;
}

.validation-comparison-panel h4 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 18px;
  color: #333;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 10px;
}

.validation-text-content {
  line-height: 1.8;
  font-size: 15px;
  color: #444;
  max-height: 600px;
  overflow-y: auto;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 8px;
  margin-bottom: 15px;
}

/* Color-coded word highlighting */
.matched-word {
  background-color: #c8e6c9;
  padding: 2px 4px;
  border-radius: 3px;
  color: #2e7d32;
  font-weight: 500;
}

.unmatched-word {
  background-color: #ffcdd2;
  padding: 2px 4px;
  border-radius: 3px;
  color: #c62828;
  font-weight: 500;
}

/* Legend */
.legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #666;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Validation Actions */
.validation-actions {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.validation-actions .secondary-btn {
  align-self: center;
}

/* Responsive Design */
@media (max-width: 768px) {
  .validation-comparison-container {
    grid-template-columns: 1fr;
  }
  
  .validation-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== ENHANCED RESULTS SECTION ==================== */

/* Primary Results Card - Download, Stats, Waveform */
.primary-results-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.primary-results-card > h3 {
  font-size: 24px;
  color: #2563eb;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Download Section */
.download-section {
  text-align: center;
  padding: 20px;
  background: white;
  border-radius: 8px;
  margin-bottom: 30px;
  border: 1px solid #e0e0e0;
}

.download-btn-large {
  font-size: 18px;
  padding: 15px 40px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: all 0.3s ease;
  margin-bottom: 10px;
}

.download-btn-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.file-info {
  color: #666;
  font-size: 14px;
  margin: 0;
}

/* Time Statistics Grid */
.time-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  grid-gap: 20px;
  gap: 20px;
  margin-bottom: 30px;
}

.time-stat-card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  border: 2px solid #e0e0e0;
  transition: all 0.3s ease;
}

.time-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.time-stat-card.original {
  border-color: #94a3b8;
}

.time-stat-card.deleted {
  border-color: #f59e0b;
}

.time-stat-card.final {
  border-color: #10b981;
}

.time-stat-card.savings {
  border-color: #6366f1;
}

.stat-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.stat-content {
  flex: 1 1;
}

.stat-content h4 {
  margin: 0 0 5px 0;
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #1e293b;
  margin: 5px 0;
}

.stat-label {
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
}

/* Waveform Section */
.waveform-section {
  background: white;
  border-radius: 10px;
  padding: 25px;
  border: 1px solid #e0e0e0;
}

.waveform-section h4 {
  font-size: 18px;
  color: #1e293b;
  margin-bottom: 8px;
}

.waveform-description {
  color: #64748b;
  font-size: 14px;
  margin-bottom: 20px;
}

.waveform-container {
  background: #f8fafc;
  border-radius: 8px;
  padding: 20px;
  border: 1px solid #e2e8f0;
}

#waveform {
  margin-bottom: 15px;
}

.waveform-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding-top: 15px;
  border-top: 1px solid #e2e8f0;
}

.control-btn {
  background: #2563eb;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.control-btn:hover {
  background: #1d4ed8;
  transform: scale(1.05);
}

.timeline-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
}

.divider {
  color: #94a3b8;
}

.current-time {
  color: #2563eb;
}

.total-time {
  color: #64748b;
}

/* Secondary Results Grid */
.secondary-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  grid-gap: 20px;
  gap: 20px;
  margin-bottom: 20px;
}

/* Transcription Actions (Restart/Cancel buttons) */
.transcribe-actions {
  margin-top: 15px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* Transcription Failed State */
.transcription-failed {
  background: #fff3cd;
  border: 2px solid #ffc107;
  border-radius: 12px;
  padding: 20px;
  margin-top: 15px;
  text-align: center;
}

.transcription-failed .error-message {
  color: #dc3545;
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 10px;
}

.transcription-failed p {
  margin: 10px 0;
}

/* Responsive Design for Enhanced Results */
@media (max-width: 768px) {
  .time-stats-grid {
    grid-template-columns: 1fr;
  }
  
  .waveform-controls {
    flex-direction: column;
  }
  
  .control-btn {
    width: 100%;
  }
  
  .primary-results-card {
    padding: 20px;
  }
  
  .download-btn-large {
    font-size: 16px;
    padding: 12px 30px;
  }
}



/* PDF Boundary Refinement Styles */
.pdf-boundary-refinement {
  background: white;
  border-radius: 8px;
  padding: 30px;
  margin: 20px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.refinement-header {
  text-align: center;
  margin-bottom: 30px;
}

.refinement-header h4 {
  font-size: 24px;
  color: #333;
  margin-bottom: 10px;
}

.refinement-header p {
  color: #666;
  font-size: 16px;
}

.boundary-info {
  display: flex;
  justify-content: space-around;
  margin-bottom: 30px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
}

.boundary-stat {
  text-align: center;
}

.boundary-stat .stat-label {
  display: block;
  font-size: 14px;
  color: #666;
  margin-bottom: 5px;
}

.boundary-stat .stat-value {
  display: block;
  font-size: 24px;
  font-weight: bold;
  color: #6f42c1;
}

.pdf-text-display {
  margin-bottom: 30px;
}

.pdf-text-display h5 {
  font-size: 18px;
  color: #333;
  margin-bottom: 15px;
}

.pdf-text-display .instruction {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 20px;
  color: #856404;
}

.text-segments {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.text-segment {
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 15px;
}

.text-segment.context-before {
  background: #f8f9fa;
  border-color: #dee2e6;
}

.text-segment.matched-section {
  background: #e7f3ff;
  border-color: #007bff;
}

.text-segment.context-after {
  background: #f8f9fa;
  border-color: #dee2e6;
}

.segment-label {
  font-weight: bold;
  color: #6f42c1;
  margin-bottom: 10px;
  padding: 5px 10px;
  background: rgba(111, 66, 193, 0.1);
  border-radius: 4px;
  display: inline-block;
}

.segment-text {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: #333;
}

.segment-text.selectable {
  width: 100%;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 15px;
  resize: vertical;
  min-height: 300px;
  font-family: 'Courier New', monospace;
  background: white;
}

.segment-text.selectable:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.selection-info {
  margin-top: 15px;
  padding: 15px;
  background: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 4px;
  text-align: center;
}

.selection-info p {
  margin: 0 0 10px 0;
  color: #155724;
  font-weight: bold;
}

.apply-selection-btn {
  background: #28a745;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
}

.apply-selection-btn:hover {
  background: #218838;
}

.refinement-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

.cancel-btn {
  background: #6c757d;
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
}

.cancel-btn:hover {
  background: #5a6268;
}

.cancel-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.save-boundaries-btn {
  background: #007bff;
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
}

.save-boundaries-btn:hover {
  background: #0056b3;
}

.save-boundaries-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.refine-boundaries-btn {
  background: #ffc107;
  color: #333;
  border: none;
  padding: 12px 30px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.refine-boundaries-btn:hover {
  background: #e0a800;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* PrivacySecurityPage.css */

.privacy-security-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.privacy-header {
  text-align: center;
  margin-bottom: 40px;
}

.privacy-header h1 {
  font-size: 48px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.privacy-header p {
  font-size: 20px;
  color: #666;
}

/* Tab Navigation */
.tab-navigation {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 15px 30px;
  border: 2px solid #667eea;
  border-radius: 12px;
  background: white;
  color: #667eea;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tab-btn:hover {
  background: #f0f0ff;
  transform: translateY(-2px);
}

.tab-btn.active {
  background: #667eea;
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Content Sections */
.content-section {
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 40px;
}

.content-section h2 {
  font-size: 36px;
  margin-bottom: 10px;
  color: #333;
}

.content-section .subtitle {
  font-size: 18px;
  color: #666;
  margin-bottom: 30px;
}

.last-updated {
  color: #999;
  font-size: 14px;
  margin-bottom: 30px;
}

/* Policy Sections */
.policy-section,
.security-section,
.data-section {
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid #f0f0f0;
}

.policy-section:last-child,
.security-section:last-child,
.data-section:last-child {
  border-bottom: none;
}

.policy-section h3,
.security-section h3,
.data-section h3 {
  font-size: 24px;
  margin-bottom: 20px;
  color: #667eea;
}

.policy-section h4,
.security-section h4,
.data-section h4 {
  font-size: 18px;
  margin-bottom: 10px;
  color: #333;
}

/* Tables */
.data-table table,
.data-storage-table table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.data-table th,
.data-table td,
.data-storage-table th,
.data-storage-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}

.data-table th,
.data-storage-table th {
  background: #f8f8ff;
  color: #667eea;
  font-weight: 600;
  font-size: 14px;
}

.data-table td strong,
.data-storage-table td strong {
  color: #333;
}

/* Feature Lists */
.feature-list {
  list-style: none;
  padding: 0;
}

.feature-list li {
  padding: 12px 0;
  display: flex;
  align-items: flex-start;
  line-height: 1.6;
}

.feature-list .check,
.feature-list .cross {
  margin-right: 12px;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.feature-list .check {
  color: #10b981;
}

.feature-list .cross {
  color: #ef4444;
}

/* Protection Grid */
.protection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  grid-gap: 20px;
  gap: 20px;
  margin: 20px 0;
}

.protection-card {
  background: #f8f8ff;
  padding: 25px;
  border-radius: 12px;
  border: 2px solid #e0e0ff;
}

.protection-card h4 {
  margin-bottom: 15px;
  font-size: 18px;
}

.protection-card p {
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}

/* Rights List */
.rights-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  grid-gap: 20px;
  gap: 20px;
  margin: 20px 0;
}

.right-item {
  background: #f8f8ff;
  padding: 25px;
  border-radius: 12px;
  border: 2px solid #e0e0ff;
}

.right-item h4 {
  margin-bottom: 10px;
  color: #667eea;
}

.right-item p {
  margin-bottom: 15px;
  color: #666;
  font-size: 14px;
}

/* Buttons */
.action-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  background: #667eea;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.action-btn:hover {
  background: #5568d3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.action-btn.danger {
  background: #ef4444;
}

.action-btn.danger:hover {
  background: #dc2626;
}

.danger-btn {
  padding: 12px 24px;
  border: 2px solid #ef4444;
  border-radius: 8px;
  background: white;
  color: #ef4444;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 20px;
}

.danger-btn:hover {
  background: #ef4444;
  color: white;
}

/* Security Features */
.security-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  grid-gap: 25px;
  gap: 25px;
  margin: 20px 0;
}

.feature-card {
  background: white;
  padding: 25px;
  border-radius: 12px;
  border: 2px solid #f0f0f0;
  transition: all 0.3s ease;
}

.feature-card:hover {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
  transform: translateY(-4px);
}

.feature-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 15px;
}

.feature-card h4 {
  margin-bottom: 15px;
  color: #667eea;
}

.feature-card ul {
  list-style: none;
  padding: 0;
}

.feature-card ul li {
  padding: 8px 0;
  padding-left: 25px;
  position: relative;
  font-size: 14px;
  color: #666;
}

.feature-card ul li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #10b981;
  font-weight: 700;
}

/* Encryption Info */
.encryption-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  grid-gap: 25px;
  gap: 25px;
  margin: 20px 0;
}

.encryption-card {
  background: #f0f8ff;
  padding: 30px;
  border-radius: 12px;
  border: 2px solid #667eea;
}

.encryption-card h4 {
  margin-bottom: 15px;
  color: #667eea;
}

.encryption-card ul {
  list-style: none;
  padding: 0;
}

.encryption-card ul li {
  padding: 8px 0;
  font-size: 14px;
  color: #333;
}

/* Payment Security */
.payment-security {
  background: #f8f8ff;
  padding: 30px;
  border-radius: 12px;
  margin: 20px 0;
}

.stripe-info h4 {
  margin-bottom: 15px;
  color: #635bff;
}

.stripe-info ul {
  list-style: none;
  padding: 0;
}

.stripe-info ul li {
  padding: 8px 0;
  padding-left: 25px;
  position: relative;
  font-size: 14px;
}

.stripe-info ul li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #10b981;
  font-weight: 700;
}

.note {
  background: #fffbeb;
  border-left: 4px solid #fbbf24;
  padding: 15px;
  margin-top: 20px;
  font-size: 14px;
  color: #92400e;
}

/* Infrastructure Grid */
.infrastructure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  grid-gap: 20px;
  gap: 20px;
  margin: 20px 0;
}

.infra-card {
  background: #f8f8ff;
  padding: 25px;
  border-radius: 12px;
  border: 2px solid #e0e0ff;
}

.infra-card h4 {
  margin-bottom: 15px;
  color: #667eea;
}

.infra-card ul {
  list-style: none;
  padding: 0;
}

.infra-card ul li {
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
  font-size: 14px;
  color: #666;
}

.infra-card ul li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #667eea;
  font-weight: 700;
}

/* Report Box */
.report-box {
  background: #fef2f2;
  border: 2px solid #ef4444;
  border-radius: 12px;
  padding: 25px;
  margin: 20px 0;
}

.report-box a {
  color: #ef4444;
  font-weight: 600;
  text-decoration: none;
}

.report-box a:hover {
  text-decoration: underline;
}

/* Access Grid */
.access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  grid-gap: 20px;
  gap: 20px;
  margin: 20px 0;
}

.access-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  border: 2px solid #f0f0f0;
  text-align: center;
  transition: all 0.3s ease;
}

.access-card:hover {
  border-color: #667eea;
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.access-card h4 {
  margin-bottom: 10px;
  font-size: 18px;
}

.access-card p {
  font-size: 14px;
  color: #666;
}

/* Deletion Options */
.deletion-info {
  margin: 20px 0;
}

.deletion-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  grid-gap: 25px;
  gap: 25px;
  margin: 20px 0;
}

.deletion-option {
  background: #f0f0f0;
  padding: 25px;
  border-radius: 12px;
}

.deletion-option h4 {
  margin-bottom: 10px;
  color: #ef4444;
}

.deletion-option ul {
  list-style: none;
  padding: 0;
  margin-top: 15px;
}

.deletion-option ul li {
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
  font-size: 14px;
  color: #666;
}

.deletion-option ul li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #ef4444;
  font-weight: 700;
}

/* Trust Badges */
.trust-badges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  grid-gap: 25px;
  gap: 25px;
  margin-top: 60px;
  padding-top: 40px;
  border-top: 2px solid #f0f0f0;
}

.badge {
  background: white;
  padding: 30px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.badge:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.2);
}

.badge-icon {
  font-size: 64px;
  display: block;
  margin-bottom: 15px;
}

.badge h3 {
  font-size: 20px;
  margin-bottom: 10px;
  color: #333;
}

.badge p {
  font-size: 14px;
  color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
  .privacy-header h1 {
    font-size: 32px;
  }

  .content-section {
    padding: 20px;
  }

  .tab-navigation {
    flex-direction: column;
  }

  .tab-btn {
    width: 100%;
  }

  .protection-grid,
  .rights-list,
  .security-features,
  .encryption-info,
  .infrastructure-grid,
  .access-grid,
  .deletion-options,
  .trust-badges {
    grid-template-columns: 1fr;
  }

  .data-table table,
  .data-storage-table table {
    font-size: 12px;
  }

  .data-table th,
  .data-table td,
  .data-storage-table th,
  .data-storage-table td {
    padding: 10px;
  }
}

/* Print Styles */
@media print {
  .tab-navigation,
  .action-btn,
  .danger-btn {
    display: none;
  }

  .content-section {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

.WAVupload-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 2rem 0;
}

.WAVupload-button {
  background-color: #232946;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.7rem 1.8rem;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  box-shadow: 0 2px 8px rgba(35, 41, 70, 0.07);
}

.WAVupload-button:hover {
  background-color: #eebbc3;
  color: #232946;
}
.WaveformDisplay-container {
  margin: 2rem auto;
  max-width: 800px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(35,41,70,0.08);
  padding: 2rem;
}

.WaveformDisplay-waveform {
  width: 100%;
  margin-bottom: 2rem;
}

.WaveformDisplay-transcript {
  font-size: 1.2rem;
  color: #232946;
  line-height: 2.2;
  word-break: break-word;
}

.WaveformDisplay-segment {
  padding: 0.2em 0.4em;
  border-radius: 4px;
  margin-right: 0.2em;
  transition: background 0.2s;
}

.WaveformDisplay-segment-repetitive {
  background: rgba(255, 0, 0, 0.15);
  color: #c00;
  border-radius: 4px;
  padding: 2px 4px;
  margin: 0 2px;
}
.WaveformDisplay-segment-selected {
  outline: 2px solid #c00;
  background: rgba(255, 0, 0, 0.3);
}
.audiopage-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.audiopage-processing-box {
  text-align: center;
  margin: 2rem auto;
  font-size: 1.2rem;
  max-width: 500px;
  background: #f6f6f6;
  border-radius: 12px;
  box-shadow: 0 2px 8px #0001;
  padding: 2rem 1.5rem;
}

.audiopage-uploading-text {
  margin-bottom: 1rem;
  font-weight: bold;
}

.audiopage-progress-bar-bg {
  width: 80%;
  margin: 1rem auto;
  background: #eee;
  border-radius: 8px;
  height: 16px;
  overflow: hidden;
}

.audiopage-progress-bar {
  height: 100%;
  background: #232946;
  border-radius: 8px;
  transition: width 0.2s;
}

.audiopage-waiting-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  font-size: 1.1rem;
  color: #232946;
}

.audiopage-spinner {
  width: 40px;
  height: 40px;
  border: 5px solid #b8c1ec;
  border-top: 5px solid #232946;
  border-radius: 50%;
  animation: audiopage-spin 1s linear infinite;
  margin-bottom: 0.5rem;
}

@keyframes audiopage-spin {
  0% { transform: rotate(0deg);}
  100% { transform: rotate(360deg);}
}

.audiopage-edit-btn {
  margin-top: 2rem;
  padding: 1rem 2rem;
  font-size: 1.2rem;
  background: #232946;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.audiopage-edit-btn:disabled {
  background: #aaa;
  cursor: not-allowed;
}

.audiopage-infinity-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
}

.infinity-svg {
  display: block;
}

.infinity-path {
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: infinity-draw 1.5s linear infinite;
}

@keyframes infinity-draw {
  0% {
    stroke-dashoffset: 220;
  }
  50% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: -220;
  }
}
/* Processing Mode Selector */
.processing-mode-selector {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: white;
}

.processing-mode-toggle {
  margin-bottom: 1rem;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
}

.toggle-label input[type="checkbox"] {
  width: 50px;
  height: 26px;
  -webkit-appearance: none;
          appearance: none;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 13px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
}

.toggle-label input[type="checkbox"]::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-label input[type="checkbox"]:checked {
  background: rgba(76, 217, 100, 0.5);
}

.toggle-label input[type="checkbox"]:checked::before {
  transform: translateX(24px);
}

.toggle-label input[type="checkbox"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.toggle-text {
  font-size: 1.2rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.processing-mode-info {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.processing-mode-info p {
  margin: 0;
}

.processing-mode-info strong {
  font-weight: 600;
}

.model-loading {
  background: #fff3cd;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.model-loading p {
  margin: 0.5rem 0;
}

.audiopage-estimate {
  margin-top: 1rem;
}

.audiopage-motivation {
  margin-top: 1.5rem;
  font-style: italic;
  color: #666;
  font-size: 1rem;
}

.awfd-container {
  width: 100%;
}

.awfd-time-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-family: monospace;
  font-size: 1.1em;
  justify-content: flex-end;
}

.awfd-waveform {
  width: 100%;
  margin-bottom: 1rem;
}

.awfd-current-time,
.awfd-duration {
  min-width: 40px;
  text-align: right;
}

.awfd-divider {
  color: #888;
}

.awfd-controls-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.awfd-play-btn {
  padding: 0.4rem 1rem;
  border: none;
  border-radius: 4px;
  background: #232946;
  color: #fff;
  cursor: pointer;
  font-size: 1.3em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.awfd-zoom-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.awfd-zoom-slider {
  width: 120px;
}

.awfd-zoom-value {
  min-width: 40px;
  display: inline-block;
}

.awfd-speed-label {
  margin-right: 0.5rem;
}

.awfd-speed-btn {
  font-weight: normal;
  background: #eee;
  color: #232946;
  border: none;
  border-radius: 4px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  margin-right: 0.3rem;
}

.awfd-speed-btn-active {
  font-weight: bold;
  background: #232946;
  color: #fff;
}
.regionlist-container {
  width: 100%;
}

.regionlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.regionlist-deleteall-btn {
  background: #c00;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  margin-left: 1rem;
  opacity: 1;
  transition: opacity 0.2s;
}
.regionlist-deleteall-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.regionlist-scrollbox {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0.5rem;
  margin-top: 0.5rem;
  background: #f8f8f8;
}

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

.regionlist-li {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  justify-content: space-between;
}

.regionlist-keep {
  color: green;
}

.regionlist-delete {
  color: red;
}

.regionlist-info {
  display: flex;
  align-items: center;
}

.regionlist-play-btn {
  margin-right: 0.5rem;
}

.regionlist-switch {
  display: flex;
  align-items: center;
  margin-left: 0.5rem;
}

.regionlist-switch-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.regionlist-switch-label input[type="checkbox"] {
  opacity: 0;
  width: 0;
  height: 0;
}

.regionlist-slider {
  width: 48px;
  height: 24px;
  border-radius: 12px;
  background: #c00;
  position: relative;
  transition: background 0.2s;
  margin-right: 0.5rem;
  display: inline-block;
}
.regionlist-slider-keep {
  background: green;
}
.regionlist-slider-delete {
  background: #c00;
}
.regionlist-slider-knob {
  position: absolute;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.2s;
}
.regionlist-slider::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.2s;
}
.regionlist-switch-label input[type="checkbox"]:checked + .regionlist-slider::before {
  left: 26px;
}
.regionlist-switch-text {
  font-weight: bold;
}
.regionlist-keep-label {
  color: green;
}
.regionlist-delete-label {
  color: #c00;
}
/* FinalAudioPlayer.css */

.final-audio-container {
  margin-top: 2rem;
  padding: 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: #f9f9f9;
}

.final-audio-title {
  font-weight: bold;
  margin-bottom: 1rem;
  color: #333;
}

.final-audio-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.final-audio-player {
  width: 100%;
  border-radius: 5px;
}

.download-button-container {
  display: flex;
  justify-content: center;
}

.download-button {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.download-button:hover {
  background: linear-gradient(135deg, #45a049, #3d8b40);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.download-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.download-button:disabled {
  background: #cccccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.no-audio-message {
  color: #666;
  font-style: italic;
  text-align: center;
  padding: 2rem;
}

/* Download icon using CSS */
.download-icon::before {
  content: "⬇";
  font-size: 14px;
}
.noiseregionlist-container {
  width: 100%;
}

.noiseregionlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.noiseregionlist-deleteall-btn {
  background: #c00;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  margin-left: 1rem;
  opacity: 1;
  transition: opacity 0.2s;
}
.noiseregionlist-deleteall-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.noiseregionlist-scrollbox {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0.5rem;
  margin-top: 0.5rem;
  background: #f8f8f8;
}

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

.noiseregionlist-li {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  justify-content: space-between;
}

.noiseregionlist-keep {
  color: green;
}

.noiseregionlist-delete {
  color: red;
}

.noiseregionlist-info {
  display: flex;
  align-items: center;
}

.noiseregionlist-play-btn {
  margin-right: 0.5rem;
}

.noiseregionlist-switch {
  display: flex;
  align-items: center;
  margin-left: 0.5rem;
}

.noiseregionlist-switch-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.noiseregionlist-switch-label input[type="checkbox"] {
  opacity: 0;
  width: 0;
  height: 0;
}

.noiseregionlist-slider {
  width: 48px;
  height: 24px;
  border-radius: 12px;
  background: #c00;
  position: relative;
  transition: background 0.2s;
  margin-right: 0.5rem;
  display: inline-block;
}
.noiseregionlist-slider-keep {
  background: green;
}
.noiseregionlist-slider-delete {
  background: #c00;
}
.noiseregionlist-slider-knob {
  position: absolute;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.2s;
}
.noiseregionlist-slider::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.2s;
}
.noiseregionlist-switch-label input[type="checkbox"]:checked + .noiseregionlist-slider::before {
  left: 26px;
}
.noiseregionlist-switch-text {
  font-weight: bold;
}
.noiseregionlist-keep-label {
  color: green;
}
.noiseregionlist-delete-label {
  color: #c00;
}
