/* 
  Precatorista - Sistema Profissional de Cálculos Judiciais
  Design Limpo e Elegante com Cabeçalho/Rodapé Escuros
*/

:root {
  /* Color Palette */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f8f8;
  --bg-card: #ffffff;
  --bg-input: #f5f5f5;
  --bg-dark: #000000;
  --border-light: #e5e5e5;
  --border-medium: #d0d0d0;
  --text-primary: #1a1a1a;
  --text-secondary: #6b6b6b;
  --text-muted: #999999;
  --text-white: #ffffff;
  --accent-green: #22c55e;
  --accent-gold: #fbbf24;
  --accent-blue: #3b82f6;
  
  /* Typography */
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
}

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

body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Container */
.container-main {
  max-width: 520px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
}

.container-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
}

/* Dark Navigation */
.nav-dark {
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: saturate(180%) blur(20px);
  padding: 0.375rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 0.5px solid rgba(255,255,255,0.1);
}

.nav-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-white);
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: opacity 0.2s;
}

.nav-logo:hover {
  opacity: 0.8;
}

.nav-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* Badge Pills */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.625rem;
  background: rgba(255,255,255,0.08);
  border: 0.5px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 400;
  transition: all 0.2s ease;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.badge-pill:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.2);
  color: var(--text-white);
  transform: scale(1.02);
}

.badge-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gold);
  color: var(--bg-dark);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-green {
  background: var(--accent-green);
  color: white;
  border-color: var(--accent-green);
  font-weight: 500;
}

.badge-green:hover {
  background: #16a34a;
  border-color: #16a34a;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
  transform: scale(1.02);
}

.badge-text-small {
  display: none;
}

/* Main Content */
main {
  flex: 1;
  background: var(--bg-primary);
}

.hero-section {
  padding: 0.75rem 0;
  text-align: center;
  background: var(--bg-primary);
}

.hero-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.125rem;
  letter-spacing: -0.03em;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

/* Form Card */
.form-card {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid var(--border-light);
}

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

.form-label {
  display: block;
  font-size: 0.813rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.form-sublabel {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 0.25rem;
}

.form-input {
  width: 100%;
  padding: 0.5rem 0.625rem;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-green);
  background: var(--bg-primary);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
}

select.form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

/* Character Counter */
.char-counter {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* File Upload */
.file-upload {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--bg-input);
  border: 2px dashed var(--border-medium);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.file-upload:hover {
  background: var(--bg-secondary);
  border-color: var(--text-secondary);
}

.file-upload.active {
  border-color: var(--accent-green);
  background: rgba(34, 197, 94, 0.05);
}

.file-upload-content {
  text-align: center;
}

.file-upload-icon {
  font-size: 2rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.file-upload-text {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.file-upload input[type="file"] {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Link Button */
.link-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-green);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: opacity 0.2s;
}

.link-button:hover {
  opacity: 0.8;
}

/* Primary Button */
.btn-primary {
  width: 100%;
  padding: 0.5rem 1.25rem;
  background: linear-gradient(135deg, var(--accent-green), #16a34a);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.35);
}

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

/* Collapsible Section */
.collapsible {
  margin-top: 1.5rem;
}

.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  cursor: pointer;
  user-select: none;
}

.collapsible-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.collapsible-icon {
  color: var(--text-muted);
  transition: transform 0.2s;
}

.collapsible.open .collapsible-icon {
  transform: rotate(180deg);
}

.collapsible-content {
  display: none;
  padding-top: 0.5rem;
}

.collapsible.open .collapsible-content {
  display: block;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 3rem 0;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Value Cards */
.value-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.3s;
}

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

.value-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--accent-green);
  font-size: 1.5rem;
}

.value-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.value-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Table */
.table-white {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
}

.table-white thead {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
}

.table-white th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table-white td {
  padding: 1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-light);
}

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

.table-white tbody tr:hover {
  background: var(--bg-secondary);
}

/* Footer API Status */
.api-status-footer {
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: saturate(180%) blur(20px);
  padding: 0.375rem 0;
  margin-top: auto;
  border-top: 0.5px solid rgba(255,255,255,0.1);
}

.api-status-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.api-indicators {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.api-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  font-weight: 400;
}

.api-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
}

.api-dot.yellow {
  background: var(--accent-gold);
}

/* Alert Box */
.alert-info {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 1rem;
  margin: 1rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.alert-icon {
  color: var(--accent-green);
  margin-top: 0.125rem;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.alert-text {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-secondary);
  border-radius: 12px;
}

.empty-icon {
  width: 80px;
  height: 80px;
  background: var(--bg-input);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .api-indicators {
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .nav-actions {
    display: none;
  }
  
  .container-main {
    padding: 2rem 1rem;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}