/* =========================
   MIND RUSH - CSS CORE/FOUNDATION
   Versão reorganizada e otimizada
========================= */

/* =========================
   FONTES
========================= */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&family=Roboto:wght@300;400;500;700&display=swap');

/* =========================
   VARIÁVEIS CSS
========================= */
:root {
  /* Cores principais */
  --primary: #D8328F;
  --secondary: #29D8E4;
  --bg-dark: #1A1A3D;
  --bg-darker: #1F1F45;
  --bg-card: #23234F;
  --text: #E0E0E0;
  --text-muted: #9CA3AF;
  --border-glass: rgba(255, 255, 255, 0.1);
  
  /* Estados */
  --error: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --btn-hover: var(--secondary);

  /* Gradientes */
  --hero-gradient: 
    radial-gradient(ellipse 70% 80% at 20% 50%, hsla(300, 75%, 45%, 0.4) 0px, transparent 100%),
    radial-gradient(ellipse 50% 80% at 80% 50%, hsla(185, 85%, 50%, 0.5) 0px, transparent 100%);

  /* Tipografia */
  --font-primary: 'Poppins', system-ui, sans-serif;
  --font-secondary: 'Roboto', system-ui, sans-serif;
  --font-size-base: clamp(14px, 2.5vw, 16px);

  /* Animações */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --header-height: 100px;
  --section-padding: clamp(3rem, 8vw, 5rem) 0;
  --card-padding: clamp(1rem, 4vw, 2rem);
  --container-padding: clamp(1rem, 3vw, 1.5rem);
  --desktop: 1200px;
  --tablet: 768px;
  --mobile: 480px;

  /* Z-index hierarchy */
  --z-base: 1;
  --z-dropdown: 10;
  --z-header: 1001;
  --z-modal: 1000;
}

/* =========================
   PREFERÊNCIAS DE MOVIMENTO REDUZIDO
========================= */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition: none;
    --transition-slow: none;
  }
  
  *, 
  *::before, 
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================
   RESET MODERNO
========================= */
*, 
*::before, 
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: var(--font-size-base);
  -webkit-text-size-adjust: 100%;
  height: 100%;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-dark);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  line-height: 1.6;
  font-feature-settings: "kern" 1;
  min-height: 100vh;
}

/* =========================
   ESTADOS DE CARREGAMENTO
========================= */
.loading * {
  transition: none !important;
  animation: none !important;
}

html.loading {
  overflow: hidden;
}

.loading .hero-bg::before,
.loading .page-header::before {
  animation-play-state: paused;
}

/* =========================
   ELEMENTOS BASE
========================= */
a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* =========================
   SCROLLBAR PERSONALIZADA
========================= */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(45deg, var(--secondary), var(--primary));
}

/* =========================
   ACESSIBILIDADE
========================= */

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link para acessibilidade */
.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 9999;
  padding: 8px 16px;
  background: var(--bg-dark);
  color: var(--text);
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  transition: left 0.3s;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
}

/* Navegação por teclado */
body.keyboard-navigation *:focus {
  outline: 2px solid var(--secondary) !important;
  outline-offset: 2px !important;
}

/* =========================
   UTILITÁRIOS
========================= */
.text-center { 
  text-align: center; 
}

.mb-8 { 
  margin-bottom: 2rem; 
}

.mt-8 { 
  margin-top: 2rem; 
}

.col-span-full {
  grid-column: 1 / -1;
}

/* =========================
   ESTADOS VAZIOS E ERRO
========================= */
.empty-state,
.error-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  border: 1px dashed var(--border-glass);
  border-radius: 1rem;
  background: rgba(35, 35, 79, 0.3);
}

.empty-state h3 {
  color: var(--text);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.empty-state p {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0;
}

/* =========================
   ANIMAÇÕES BÁSICAS
========================= */
@keyframes spin {
  to { 
    transform: rotate(360deg); 
  }
}

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

.project-item.hidden,
.blog-item.hidden {
  display: none !important;
}

.project-item.show-animation,
.blog-item.show-animation {
  animation: fadeInUp 0.5s ease forwards;
}

/* =========================
   RESPONSIVE BASE
========================= */
@media (max-width: 480px) {
  .text-center {
    text-align: left;
  }
}

/* =========================
   PREFERÊNCIAS DO SISTEMA
========================= */

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --border-glass: rgba(255, 255, 255, 0.3);
    --text-muted: #CCCCCC;
  }
}

/* Dark mode automático (preparado para futuro) */
@media (prefers-color-scheme: light) {
  /* Variáveis de light mode podem ser adicionadas aqui no futuro */
}

/* =========================
   PRINT STYLES
========================= */
@media print {
  .hero-bg::before,
  .page-header::before,
  .contact-form::before {
    display: none;
  }
  
  .navbar,
  .dropdown-menu,
  footer {
    display: none;
  }
  
  main {
    padding-top: 0 !important;
  }
  
  * {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
  }
}

