/* ============================================
   Portal de Periódicos - Estilos Personalizados
   ============================================ */

/* ============================================
   Variáveis CSS Personalizadas
   ============================================ */
:root {
  --color-primary: #0f766e;
  --color-primary-light: #14b8a6;
  --color-primary-dark: #0d5f59;
  --color-accent: #f59e0b;
  --color-accent-light: #fbbf24;
  --color-background: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-xl: 2rem;
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode variables */
.dark {
  --color-primary: #14b8a6;
  --color-primary-light: #2dd4bf;
  --color-primary-dark: #0f766e;
  --color-background: #0f172a;
  --color-surface: #1e293b;
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --color-border: #334155;
}

/* ============================================
   Reset e Base
   ============================================ */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--color-background) !important;
  color: var(--color-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Padrão de fundo sutil */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(20, 184, 166, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(245, 158, 11, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

.dark body::before {
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(20, 184, 166, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(245, 158, 11, 0.05) 0%, transparent 50%);
}

/* ============================================
   Header Melhorado
   ============================================ */
header {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--color-border);
  box-shadow: none !important;
  padding: 1rem 2rem !important;
  transition: all var(--transition-normal);
}

.dark header {
  background: rgba(15, 23, 42, 0.85) !important;
  border-bottom-color: var(--color-border);
}

/* Logo animation */
header a[aria-label="Home page"] svg {
  transition: all var(--transition-normal);
}

header a[aria-label="Home page"]:hover svg {
  transform: rotate(180deg) scale(1.1);
  color: var(--color-primary) !important;
}

/* Botões do header */
header .pkp_navigation_user a,
header button {
  transition: all var(--transition-fast);
}

header .pkp_navigation_user a:hover {
  background: var(--color-primary) !important;
  color: white !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Badge de notificações */
.task_count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.5rem;
  margin-left: 0.5rem;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-light)) !important;
  color: white !important;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ============================================
   Main Content
   ============================================ */
main {
  padding: 3rem 2rem !important;
  max-width: 1400px !important;
  margin: 0 auto;
}

/* ============================================
   Seção Sobre / Missão
   ============================================ */
.about_site {
  position: relative;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  padding: 3rem !important;
  border-radius: var(--radius-xl) !important;
  margin-bottom: 3rem;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.about_site::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
  pointer-events: none;
}

.about_site::after {
  content: '📚';
  position: absolute;
  right: 2rem;
  bottom: 1rem;
  font-size: 6rem;
  opacity: 0.1;
  filter: grayscale(1);
}

.about_site p {
  color: white !important;
  position: relative;
  z-index: 1;
}

.about_site strong {
  color: white !important;
  font-weight: 500;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.about_site p:first-of-type strong {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1rem;
  font-weight: 600;
  display: block;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

/* ============================================
   Título das Revistas
   ============================================ */
.journals h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.5rem !important;
  font-weight: 600 !important;
  color: var(--color-text) !important;
  margin-bottom: 2rem !important;
  position: relative;
  padding-bottom: 1rem;
}

.journals h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: 2px;
}

.dark .journals h2 {
  color: var(--color-text) !important;
}

/* ============================================
   Cards das Revistas
   ============================================ */
.journals ul.list-none {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 2rem !important;
  padding: 0 !important;
}

.journals ul.list-none > li {
  display: flex !important;
  flex-direction: column !important;
  background: var(--color-surface) !important;
  border-radius: var(--radius-lg) !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden;
  box-shadow: var(--shadow-md) !important;
  border: 1px solid var(--color-border);
  transition: all var(--transition-normal);
  position: relative;
}

.journals ul.list-none > li:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl) !important;
  border-color: var(--color-primary);
}

.dark .journals ul.list-none > li {
  background: var(--color-surface) !important;
  border-color: var(--color-border);
}

/* Thumbnail da revista */
.journals li .thumb {
  width: 100% !important;
  height: 200px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.journals li .thumb::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
  pointer-events: none;
}

.journals li .thumb a {
  display: block;
  width: 100%;
  height: 100%;
}

.journals li .thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  transition: transform var(--transition-slow);
}

.journals li:hover .thumb img {
  transform: scale(1.08);
}

/* Corpo do card */
.journals li .body {
  padding: 1.5rem !important;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Título da revista */
.journals li .body h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  margin-bottom: 1rem !important;
}

.journals li .body h3 a {
  color: var(--color-text) !important;
  text-decoration: none !important;
  transition: color var(--transition-fast);
  background: none !important;
  box-shadow: none !important;
}

.journals li .body h3 a:hover {
  color: var(--color-primary) !important;
}

.dark .journals li .body h3 a {
  color: var(--color-text) !important;
}

/* Descrição */
.journals li .description {
  font-size: 0.9rem !important;
  line-height: 1.7 !important;
  color: var(--color-text-muted) !important;
  margin-bottom: 1.5rem !important;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.journals li .description p {
  margin: 0 !important;
}

/* Links de ação */
.journals li .links {
  display: flex !important;
  gap: 0.75rem !important;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  list-style: none !important;
  padding-left: 0 !important;
}

.journals li .links li {
  flex: 1;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  box-shadow: none !important;
  border: none !important;
}

.journals li .links a {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem !important;
  border-radius: var(--radius-md) !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  transition: all var(--transition-fast);
  text-align: center;
}

.journals li .links li.view a {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark)) !important;
  color: white !important;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.3);
}

.journals li .links li.view a:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 118, 110, 0.4);
}

.journals li .links li.current a {
  background: transparent !important;
  color: var(--color-primary) !important;
  border: 2px solid var(--color-primary) !important;
}

.journals li .links li.current a:hover {
  background: var(--color-primary) !important;
  color: white !important;
}

/* ISSN badges */
.journals li .description strong {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(15, 118, 110, 0.1);
  color: var(--color-primary);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

/* ============================================
   Footer Melhorado
   ============================================ */
footer.footer {
  background: linear-gradient(180deg, var(--color-background), #e2e8f0) !important;
  border-top: 1px solid var(--color-border);
  padding: 3rem 2rem !important;
  margin-top: 4rem;
}

.dark footer.footer {
  background: linear-gradient(180deg, var(--color-background), #020617) !important;
}

footer .text-slate-500,
footer .text-slate-400 {
  color: var(--color-text-muted) !important;
}

footer p {
  margin: 0.25rem 0 !important;
  font-size: 0.9rem;
}

footer .copyright,
footer .credits {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

footer a {
  color: var(--color-primary) !important;
  text-decoration: none;
  transition: color var(--transition-fast);
}

footer a:hover {
  color: var(--color-primary-light) !important;
  text-decoration: underline;
}

/* ============================================
   Dropdown Menu
   ============================================ */
.pkp_navigation_user [x-show="open"] {
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--color-border) !important;
  box-shadow: var(--shadow-xl) !important;
  overflow: hidden;
}

.pkp_navigation_user [x-show="open"] ul li a {
  transition: all var(--transition-fast);
}

.pkp_navigation_user [x-show="open"] ul li a:hover {
  background: var(--color-primary) !important;
  color: white !important;
  padding-left: 1.5rem !important;
}

/* ============================================
   Scrollbar Personalizada
   ============================================ */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-background);
}

::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 5px;
  border: 2px solid var(--color-background);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-dark);
}

/* ============================================
   Animações
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.journals ul.list-none > li {
  animation: fadeInUp 0.6s ease-out backwards;
}

.journals ul.list-none > li:nth-child(1) { animation-delay: 0.1s; }
.journals ul.list-none > li:nth-child(2) { animation-delay: 0.2s; }
.journals ul.list-none > li:nth-child(3) { animation-delay: 0.3s; }
.journals ul.list-none > li:nth-child(4) { animation-delay: 0.4s; }
.journals ul.list-none > li:nth-child(5) { animation-delay: 0.5s; }
.journals ul.list-none > li:nth-child(6) { animation-delay: 0.6s; }
.journals ul.list-none > li:nth-child(7) { animation-delay: 0.7s; }
.journals ul.list-none > li:nth-child(8) { animation-delay: 0.8s; }
.journals ul.list-none > li:nth-child(9) { animation-delay: 0.9s; }
.journals ul.list-none > li:nth-child(10) { animation-delay: 1.0s; }

/* ============================================
   Seleção de Texto
   ============================================ */
::selection {
  background: var(--color-primary);
  color: white;
}

/* ============================================
   Foco Acessível
   ============================================ */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ============================================
   Responsividade
   ============================================ */
@media (max-width: 768px) {
  .journals ul.list-none {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  
  .about_site {
    padding: 2rem !important;
    border-radius: var(--radius-lg) !important;
  }
  
  .about_site::after {
    font-size: 4rem;
    right: 1rem;
    bottom: 0.5rem;
  }
  
  .about_site p:first-of-type strong {
    font-size: 1.5rem;
  }
  
  .journals h2 {
    font-size: 2rem !important;
  }
  
  main {
    padding: 2rem 1rem !important;
  }
  
  footer.footer {
    padding: 2rem 1rem !important;
  }
}

@media (max-width: 480px) {
  header {
    padding: 0.75rem 1rem !important;
  }
  
  .journals li .links {
    flex-direction: column;
  }
  
  .journals li .thumb {
    height: 160px;
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  header,
  footer,
  .thumb {
    display: none !important;
  }
  
  .journals ul.list-none > li {
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
  
  body::before {
    display: none;
  }
}
