/**
 * ATS Text Extractor v7
 */

* { box-sizing: border-box; margin: 0; padding: 0; }

.text-extractor-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: 50px;
  padding: 40px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  color: white;
}

.hero-section h1 {
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero-section .subtitle {
  font-size: 20px;
  opacity: 0.95;
  margin-bottom: 12px;
}

.hero-section .description {
  font-size: 16px;
  opacity: 0.85;
  max-width: 700px;
  margin: 0 auto 20px auto;
  line-height: 1.6;
}

/* Privacy Badge with Info Icon (v7 Update) */
.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.2);
  padding: 10px 20px;
  border-radius: 50px;
  margin-top: 20px;
  font-size: 14px;
  font-weight: 500;
  backdrop-filter: blur(10px);
  position: relative;
}

/* Privacy Info Icon */
.privacy-info-icon {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  margin-left: 4px;
  opacity: 0.9;
  transition: all 0.3s ease;
  position: relative;
  color: white;
}

.privacy-info-icon:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Desktop Tooltip */
@media (min-width: 769px) {
  .privacy-info-icon::after {
    content: "✓ 100% client-side processing\A✓ No server uploads\A✓ Zero data storage\A✓ Data deleted on page close";
    white-space: pre-line;
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.8;
    width: 280px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    text-align: left;
  }

  .privacy-info-icon::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .privacy-info-icon:hover::after,
  .privacy-info-icon:hover::before {
    opacity: 1;
  }
}

/* Privacy Modal (v7 New) */
.privacy-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.privacy-modal.active {
  display: flex;
}

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

.privacy-modal-content {
  background: white;
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

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

.privacy-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid #e5e7eb;
}

.privacy-modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
}

.privacy-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.privacy-modal-close:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.privacy-modal-body {
  padding: 28px;
}

.privacy-feature {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.privacy-feature:last-child {
  margin-bottom: 0;
}

.privacy-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: #10b981;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
}

.privacy-text strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
}

.privacy-text p {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
  margin: 0;
}

.privacy-modal-footer {
  padding: 20px 28px;
  border-top: 1px solid #e5e7eb;
  text-align: center;
}

.privacy-modal-button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 32px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.privacy-modal-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

/* Upload Section */
.upload-section {
  background: white;
  border-radius: 16px;
  padding: 60px 40px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.drop-zone {
  border: 3px dashed #cbd5e1;
  border-radius: 12px;
  padding: 80px 40px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.drop-zone:hover {
  border-color: #667eea;
  background: #f0f4ff;
}

.drop-zone.drag-over {
  border-color: #667eea;
  background: #e0e7ff;
  transform: scale(1.02);
}

.upload-icon {
  font-size: 64px;
  margin-bottom: 20px;
  animation: float 3s ease-in-out infinite;
}

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

.drop-zone-text {
  font-size: 24px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 12px;
}

.drop-zone-subtext {
  font-size: 16px;
  color: #64748b;
  margin-bottom: 24px;
}

.file-types {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.file-type-badge {
  background: #e0e7ff;
  color: #4c1d95;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.file-input-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Processing Section */
.processing-section {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 40px;
  text-align: center;
}

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

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

.processing-text {
  font-size: 20px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 8px;
}

.processing-subtext {
  font-size: 14px;
  color: #64748b;
}

/* Results Section */
.results-section {
  display: none;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.results-title {
  font-size: 28px;
  font-weight: 700;
  color: #1e293b;
}

.action-buttons {
  display: flex;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5568d3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #10b981;
  color: white;
}

.btn-secondary:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

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

.btn-ghost:hover {
  background: #cbd5e1;
  color: #1e293b;
  border-color: #94a3b8;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 24px;
  border-radius: 12px;
  color: white;
  text-align: center;
}

.stat-label {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 8px;
  font-weight: 500;
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
}

/* File Info */
.file-info {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.file-info-title {
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.file-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.file-info-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

/* Show borders only on mobile when stacked */
@media (max-width: 768px) {
  .file-info-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  
  .file-info-item {
    border-bottom: 1px solid #e2e8f0;
  }
  
  .file-info-item:last-child {
    border-bottom: none;
  }
}

.file-info-label {
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
}

.file-info-value {
  font-size: 14px;
  color: #1e293b;
  font-weight: 600;
}

/* Text Display */
.text-display {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
}

.text-display-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e2e8f0;
}

.text-display-title {
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.extracted-text-content {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.8;
  color: #334155;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 600px;
  overflow-y: auto;
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
}

.extracted-text-content::-webkit-scrollbar {
  width: 8px;
}

.extracted-text-content::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.extracted-text-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.extracted-text-content::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Info Box */
.info-box {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.info-box-title {
  font-size: 16px;
  font-weight: 600;
  color: #1e40af;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-box-content {
  font-size: 14px;
  color: #1e3a8a;
  line-height: 1.6;
}

.info-box-content ul {
  margin: 8px 0;
  padding-left: 20px;
}

.info-box-content li {
  margin: 4px 0;
}

/* Messages */
.error-message {
  display: none;
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
}

.success-message {
  display: none;
  background: #d1fae5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  animation: slideDown 0.3s ease;
}

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

/* Responsive */
@media (max-width: 768px) {
  .hero-section h1 {
    font-size: 32px;
  }
  
  .hero-section .subtitle {
    font-size: 18px;
  }
  
  .results-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .action-buttons {
    width: 100%;
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .drop-zone {
    padding: 60px 20px;
  }
  
  .upload-section {
    padding: 40px 20px;
  }

  /* Privacy Modal Mobile */
  .privacy-modal-content {
    margin: 20px;
    max-height: calc(100vh - 40px);
  }

  .privacy-modal-header,
  .privacy-modal-body,
  .privacy-modal-footer {
    padding: 20px;
  }

  .privacy-feature {
    gap: 12px;
  }

  .privacy-icon {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .text-extractor-container {
    padding: 20px 15px;
  }
  
  .hero-section {
    padding: 30px 20px;
  }
  
  .hero-section h1 {
    font-size: 28px;
  }
}