/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  line-height: 1.6;
  color: #333;
}

/* Container */
.container {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 30px;
  animation: fadeIn 0.3s ease-in;
}

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

/* Header */
.header {
  text-align: center;
  margin-bottom: 30px;
  position: relative;
}

.header h1 {
  font-size: 28px;
  color: #667eea;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.header h2 {
  font-size: 24px;
  color: #667eea;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.header .subtitle {
  font-size: 16px;
  color: #666;
}

.btn-back {
  position: absolute;
  top: 0;
  left: 0;
  color: #667eea;
  text-decoration: none;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s;
}

.btn-back:hover {
  color: #764ba2;
}

/* Buttons */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 30px 0;
}

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

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

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

.btn-secondary:hover {
  background: #f8f9ff;
  transform: translateY(-2px);
}

.btn-large {
  font-size: 18px;
  padding: 18px 32px;
}

/* Footer */
.footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
  color: #666;
  font-size: 14px;
}

/* Form Styles */
.form-section {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.form-section:last-of-type {
  border-bottom: none;
}

.form-section h3 {
  color: #667eea;
  font-size: 18px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

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

.required {
  color: #e74c3c;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-actions {
  margin-top: 30px;
  display: flex;
  justify-content: center;
}

/* Loading State */
.loading {
  text-align: center;
  padding: 40px;
  color: #667eea;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  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); }
}

/* Results Page */
.result-summary {
  background: #f8f9ff;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  border-left: 4px solid #667eea;
}

.summary-item {
  margin-bottom: 10px;
  font-size: 14px;
}

.summary-item:last-child {
  margin-bottom: 0;
}

.summary-item strong {
  color: #667eea;
  margin-right: 8px;
}

.ai-result {
  margin: 30px 0;
}

.ai-result h3 {
  color: #667eea;
  margin-bottom: 15px;
  font-size: 20px;
}

.ai-content {
  background: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  line-height: 1.8;
  white-space: pre-wrap;
  font-size: 14px;
}

.ai-content strong {
  color: #667eea;
  font-size: 16px;
  display: block;
  margin-top: 20px;
  margin-bottom: 10px;
}

.ai-content strong:first-child {
  margin-top: 0;
}

/* Cases List */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-state i {
  font-size: 64px;
  margin-bottom: 20px;
  display: block;
  color: #ddd;
}

.empty-state p {
  font-size: 16px;
  margin-bottom: 20px;
}

.cases-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.case-card {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s;
  display: block;
}

.case-card:hover {
  border-color: #667eea;
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
  transform: translateY(-2px);
}

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

.case-date {
  font-size: 13px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 5px;
}

.case-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.case-info {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  background: #e8ebff;
  color: #667eea;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.case-complaint {
  font-size: 14px;
  color: #333;
  line-height: 1.5;
}

.case-summary {
  font-size: 13px;
  color: #666;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  background: #fffbea;
  border-radius: 4px;
  border-left: 3px solid #f59e0b;
}

.case-summary i {
  color: #f59e0b;
  margin-top: 2px;
}

/* Case Detail Page */
.detail-section {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.detail-section:last-of-type {
  border-bottom: none;
}

.detail-section h3 {
  color: #667eea;
  font-size: 18px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.detail-item {
  padding: 10px;
  background: #f8f9ff;
  border-radius: 6px;
  font-size: 14px;
}

.detail-item strong {
  color: #667eea;
  display: block;
  margin-bottom: 5px;
}

.detail-item-full {
  padding: 15px;
  background: #f8f9ff;
  border-radius: 6px;
  margin-bottom: 15px;
}

.detail-item-full:last-child {
  margin-bottom: 0;
}

.detail-item-full strong {
  color: #667eea;
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.detail-item-full p {
  font-size: 14px;
  line-height: 1.6;
  color: #333;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .container {
    padding: 20px;
  }

  .header h1 {
    font-size: 22px;
  }

  .header h2 {
    font-size: 20px;
  }

  .btn-back {
    position: static;
    margin-bottom: 15px;
  }

  .form-section h3 {
    font-size: 16px;
  }

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

/* Print Styles */
@media print {
  body {
    background: white;
    padding: 0;
  }

  .container {
    box-shadow: none;
    padding: 20px;
  }

  .button-group,
  .btn,
  .btn-back {
    display: none;
  }
}
