/* ==========================================================================
   1. CORES E VARIÁVEIS (Design System - Tema Cinema/Red)
   ========================================================================== */
:root {
  --bg-gradient: linear-gradient(135deg, #09090b 0%, #111114 50%, #1a102f 100%);
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-input: rgba(10, 10, 12, 0.7);
  --border-color: rgba(255, 255, 255, 0.08);
  
  /* Cores Vivas (Tema Estilo Streaming) */
  --primary: #e11d48; /* Vermelho vivo */
  --primary-hover: #be123c;
  --primary-light: rgba(225, 29, 72, 0.15);
  
  --text-main: #f4f4f5;
  --text-muted: #a1a1aa;
  --danger: #f87171;
  
  --radius-lg: 24px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   2. ESTILOS BASE
   ========================================================================== */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 40px 20px;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ==========================================================================
   3. HEADER (CABEÇALHO)
   ========================================================================== */
.main-header {
  text-align: center;
}

.logo-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.main-header h1 {
  font-size: 2.2rem;
  font-weight: 900;
  margin: 0;
  letter-spacing: -0.03em;
  background: linear-gradient(to right, #ffffff, #f43f5e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-muted);
  margin-top: 6px;
  font-size: 0.95rem;
}

/* ==========================================================================
   4. PAINEL DE BUSCA (GLASSMORPHISM)
   ========================================================================== */
.search-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.search-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 24px;
}

.input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #e4e4e7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input[type="text"] {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 1rem;
  transition: var(--transition);
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
  background: rgba(10, 10, 12, 0.9);
}

/* Container de Botões Alinhados */
.action-buttons {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

button {
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
}

/* Botão Pesquisar (Vibrante) */
button.btn-primary {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.4);
}

button.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(225, 29, 72, 0.6);
}

/* Botão Limpar (Neutro Elegante) */
.btn-secondary {
  background-color: rgba(255, 255, 255, 0.06);
  color: #e4e4e7;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Filtros Avançados (Radios) */
.filters-group {
  border: none;
  padding: 0;
  margin: 0;
}

.filters-group legend {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.radio-group {
  display: flex;
  gap: 24px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  user-select: none;
}

input[type="radio"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   5. PAINEL DE RESULTADOS (CARDS DE FILMES/SÉRIES)
   ========================================================================== */
.results-panel {
  width: 100%;
}

.livro {
  display: flex;
  gap: 24px;
  padding: 24px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  transition: var(--transition);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

.livro:hover {
  transform: translateY(-4px) scale(1.01);
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.7);
}

.livro-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: flex-start;
}

.livro h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
  color: #ffffff;
  line-height: 1.3;
}

.livro p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.livro p strong {
  color: #cbd5e1;
}

.livro img {
  width: 100px;
  height: 145px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
  transition: var(--transition);
}

.livro:hover img {
  transform: scale(1.04);
}

/* ==========================================================================
   6. INTERFACES DE FEEDBACK
   ========================================================================== */
.placeholder-text {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 40px 0;
  font-size: 0.95rem;
}

.carregando {
  text-align: center;
  color: #f43f5e;
  font-weight: 600;
  padding: 40px 0;
  letter-spacing: 0.05em;
  animation: pulse 1.5s infinite ease-in-out;
}

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

.erro {
  color: var(--danger);
  background-color: rgba(225, 29, 72, 0.1);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(225, 29, 72, 0.2);
  text-align: center;
  font-size: 0.95rem;
}

/* ==========================================================================
   7. RESPONSIVIDADE (MOBILE OPTIMIZED)
   ========================================================================== */
@media (max-width: 600px) {
  body {
    padding: 20px 12px;
  }
  
  .search-panel {
    padding: 24px 16px;
  }

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

  .action-buttons {
    flex-direction: column-reverse;
    gap: 10px;
    width: 100%;
  }
  
  button {
    width: 100%;
    padding: 16px;
  }
  
  .livro {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
  }
  
  .livro img {
    width: 110px;
    height: 160px;
  }
}
