/* Web App Specific Styles */

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  min-height: calc(100vh - 70px);
}

.screen {
  animation: fadeIn 0.3s ease;
}

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

/* Auth Box */
.auth-box {
  max-width: 500px;
  margin: 4rem auto;
  background: white;
  padding: 3rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.auth-box h1 {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-dark);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"] {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 0.25rem;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.checkbox-label span {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Dashboard */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.dashboard-header h2 {
  margin: 0;
  color: var(--text-dark);
}

.claims-list {
  display: grid;
  gap: 1.5rem;
}

.claim-card {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}

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

.claim-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.claim-card h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.claim-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

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

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}

.claim-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.claim-detail-item {
  padding: 0.75rem;
  background: var(--bg-light);
  border-radius: 8px;
}

.claim-detail-item label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.claim-detail-item strong {
  color: var(--text-dark);
}

/* Upload Screen */
.upload-box {
  max-width: 700px;
  margin: 2rem auto;
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.file-upload-area {
  margin-bottom: 2rem;
}

.upload-placeholder {
  border: 3px dashed var(--border-color);
  border-radius: 12px;
  padding: 3rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.upload-placeholder:hover {
  border-color: var(--primary-color);
  background: var(--bg-light);
}

.selected-files {
  margin-bottom: 1.5rem;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-light);
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

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

.file-icon {
  font-size: 1.5rem;
}

.file-details h4 {
  margin: 0 0 0.25rem 0;
  color: var(--text-dark);
}

.file-details p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-light);
}

.remove-file-btn {
  background: none;
  border: none;
  color: var(--error-color);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: transform 0.2s;
}

.remove-file-btn:hover {
  transform: scale(1.2);
}

.upload-progress {
  text-align: center;
  padding: 2rem;
}

.upload-progress p {
  margin-top: 1rem;
  color: var(--text-light);
}

/* Claim Details */
.claim-header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.claim-header h2 {
  margin-bottom: 0.5rem;
}

.claim-header p {
  opacity: 0.9;
  margin: 0;
}

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

.section-card h3 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.similar-cases-grid {
  display: grid;
  gap: 1.5rem;
}

.case-card {
  background: var(--bg-light);
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
}

.case-card h4 {
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}

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

.case-detail {
  font-size: 0.9rem;
}

.case-detail strong {
  display: block;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
}

.case-detail span {
  color: var(--text-light);
}

.case-summary {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-light);
  line-height: 1.6;
}

.letter-text {
  background: var(--bg-light);
  padding: 1.5rem;
  border-radius: 8px;
  white-space: pre-wrap;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-dark);
  border: 1px solid var(--border-color);
  max-height: 600px;
  overflow-y: auto;
}

.action-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.disclaimer {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 2rem;
}

.disclaimer h4 {
  color: #92400e;
  margin-bottom: 0.75rem;
}

.disclaimer p {
  color: #92400e;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}

/* Loading State */
.loading-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-light);
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

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

.empty-state h3 {
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-light);
  margin-bottom: 2rem;
}

/* Back Button */
.back-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 2rem;
  padding: 0.5rem 0;
  transition: color 0.3s;
}

.back-btn:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .app-container {
    padding: 1rem;
  }

  .auth-box {
    padding: 2rem 1.5rem;
    margin: 2rem auto;
  }

  .upload-box {
    padding: 1.5rem;
  }

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

  .dashboard-header button {
    width: 100%;
  }

  .claim-card-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .claim-details-grid {
    grid-template-columns: 1fr;
  }

  .case-details {
    grid-template-columns: 1fr;
  }

  .action-buttons {
    flex-direction: column;
  }

  .action-buttons .btn {
    width: 100%;
  }
}

/* Green Theme Overrides for Webapp */
.btn-green-outline {
  background: transparent;
  border: 2px solid #0f766e;
  color: #0f766e;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-green-outline:hover {
  background: #0f766e;
  color: white;
}

/* Update gradients to single green color */
.btn-primary {
  background: #0f766e !important;
  background-image: none !important;
}

.btn-primary:hover {
  background: #115e59 !important;
}

.status-badge.pending {
  background: #ccfbf1;
  color: #0f766e;
}

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

/* Update auth box title color */
.auth-box h1 {
  color: #0f766e !important;
}

/* Update claim card titles */
.claim-card h3 {
  color: #0f766e !important;
}

/* Update upload placeholder */
.upload-placeholder {
  border-color: #ccfbf1 !important;
}

.upload-placeholder:hover {
  background: #f0fdfa !important;
  border-color: #0f766e !important;
}

/* Update file item */
.file-item {
  border-left-color: #0f766e !important;
}

/* Spinner color */
.spinner {
  border-top-color: #0f766e !important;
}

/* Navigation for webapp matches homepage */
.logo-with-image {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
}

.logo-text-new {
  font-size: 1.25rem;
}

/* Mobile-Optimized Compact Upload Screen */
.upload-box-compact {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
}

.upload-title {
  font-size: 1.5rem;
  color: #0f766e;
  margin-bottom: 1.5rem;
  text-align: center;
}

.upload-section {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.section-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}

.section-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.upload-btn-compact {
  background: #f9fafb;
  border: 2px dashed #0f766e;
  border-radius: 8px;
  padding: 0.75rem;
  font-weight: 600;
  color: #0f766e;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.9rem;
}

.upload-btn-compact:hover {
  background: #f0fdfa;
  border-color: #115e59;
}

.or-divider {
  text-align: center;
  color: #6b7280;
  font-size: 0.8rem;
  padding: 0.25rem 0;
}

.rejection-textarea {
  width: 100%;
  min-height: 80px;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
}

.rejection-textarea:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.generate-btn {
  margin-top: 1rem;
  width: 100%;
  background: #0f766e !important;
  font-size: 1rem;
  padding: 0.875rem !important;
}

.generate-btn:hover {
  background: #115e59 !important;
}

/* Progress Display */
.upload-progress-new {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1rem;
}

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

.progress-header h3 {
  font-size: 1.1rem;
  color: #0f766e;
  margin: 0;
}

#progressPercentage {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f766e;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #0f766e 0%, #14b8a6 100%);
  transition: width 0.5s ease;
  width: 0%;
}

.progress-description {
  color: #6b7280;
  font-size: 0.9rem;
  margin: 0;
}

/* Similar Claims Screen */
.similar-claims-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
}

.page-title {
  font-size: 1.75rem;
  color: #0f766e;
  margin-bottom: 0.5rem;
  text-align: center;
}

.page-subtitle {
  color: #6b7280;
  text-align: center;
  margin-bottom: 1.5rem;
}

.similar-cases-list {
  margin-bottom: 1.5rem;
}

.case-card-new {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.case-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f3f4f6;
}

.case-header h3 {
  font-size: 1rem;
  color: #0f766e;
  margin: 0;
}

.match-badge {
  background: #ccfbf1;
  color: #0f766e;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.case-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.case-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.case-label {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.case-value {
  font-size: 0.9rem;
  color: #1f2937;
  font-weight: 500;
}

.case-summary {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #f3f4f6;
}

.case-summary p {
  font-size: 0.85rem;
  color: #4b5563;
  margin: 0.25rem 0 0 0;
  line-height: 1.5;
}

/* Mobile optimization - make sure everything fits without scrolling */
@media (max-width: 768px) {
  .upload-box-compact {
    padding: 0.75rem;
  }
  
  .upload-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }
  
  .upload-section {
    padding: 0.625rem;
    margin-bottom: 0.625rem;
  }
  
  .section-label {
    font-size: 0.85rem;
  }
  
  .upload-btn-compact {
    padding: 0.625rem;
    font-size: 0.85rem;
  }
  
  .rejection-textarea {
    min-height: 60px;
    font-size: 0.85rem;
  }
  
  .generate-btn {
    padding: 0.75rem !important;
    font-size: 0.95rem;
  }
  
  .upload-progress-new {
    padding: 1rem;
  }
  
  .progress-header h3 {
    font-size: 1rem;
  }
  
  #progressPercentage {
    font-size: 1.25rem;
  }
  
  .page-title {
    font-size: 1.5rem;
  }
  
  .case-card-new {
    padding: 0.875rem;
  }
}

/* Ensure compact height on mobile devices */
@media (max-height: 700px) {
  .upload-section {
    margin-bottom: 0.5rem;
  }
  
  .rejection-textarea {
    min-height: 50px;
  }
  
  .generate-btn {
    margin-top: 0.5rem;
  }
}

/* Update disclaimer branding */
.disclaimer h4 {
  color: #0f766e;
}

/* Generated Letter Screen Styles */
.letter-container {
  max-width: 900px;
  margin: 2rem auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.letter-header {
  background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);
  color: white;
  padding: 2rem;
  text-align: center;
}

.letter-header h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.75rem;
}

.letter-header p {
  margin: 0;
  opacity: 0.9;
}

.letter-body {
  padding: 2rem;
  background: #f9fafb;
  max-height: 500px;
  overflow-y: auto;
}

.letter-body pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: 'Georgia', serif;
  line-height: 1.8;
  color: #1f2937;
  margin: 0;
  font-size: 0.95rem;
}

.letter-actions {
  padding: 1.5rem 2rem;
  background: white;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid #e5e7eb;
}

.letter-actions .btn-primary {
  flex: 1;
  min-width: 200px;
}

.letter-actions .btn-secondary {
  flex: 1;
  min-width: 150px;
}

@media (max-width: 768px) {
  .letter-container {
    margin: 1rem;
  }
  
  .letter-header {
    padding: 1.5rem 1rem;
  }
  
  .letter-header h2 {
    font-size: 1.25rem;
  }
  
  .letter-body {
    padding: 1rem;
    max-height: 400px;
  }
  
  .letter-body pre {
    font-size: 0.875rem;
  }
  
  .letter-actions {
    flex-direction: column;
    padding: 1rem;
  }
  
  .letter-actions .btn-primary,
  .letter-actions .btn-secondary {
    width: 100%;
    min-width: 100%;
  }
}
