/**
 * BASE.CSS - Sistema de Design FEMME
 * 
 * Arquivo base com variáveis CSS, reset e classes utilitárias.
 * Inspirado em Tailwind CSS, mas customizado para o padrão FEMME.
 * 
 * Estrutura:
 * 1. Variáveis CSS (Design Tokens)
 * 2. Reset CSS
 * 3. Tipografia Base
 * 4. Classes Utilitárias
 * 5. Breakpoints Responsivos
 */

/* ========================================
   1. VARIÁVEIS CSS (Design Tokens)
   ======================================== */

:root {
  /* Cores Primárias FEMME */
  --femme-purple: #58236d;
  --femme-purple-soft: #b8a1c6;
  --femme-purple-dark: #32123f;
  --femme-purple-darker: #4a1c5e;
  
  /* Cores de Fundo */
  --femme-bg: #fefefe;
  --femme-bg-alt: #fdfbff;
  --femme-bg-card: #ffffff;
  
  /* Cores de Texto */
  --femme-text: #333333;
  --femme-text-light: #555555;
  --femme-text-lighter: #777777;
  --femme-text-muted: #999999;
  
  /* Cores de Borda */
  --femme-border: #e7e3ee;
  --femme-border-light: rgba(184, 161, 198, 0.25);
  --femme-border-medium: rgba(184, 161, 198, 0.35);
  --femme-border-strong: rgba(184, 161, 198, 0.45);
  
  /* Cores de Estado */
  --femme-success: #28a745;
  --femme-success-light: #4ec58d;
  --femme-warning: #ffc107;
  --femme-danger: #dc3545;
  --femme-danger-light: #f8d7da;
  --femme-danger-text: #721c24;
  --femme-info: #17a2b8;
  
  /* Sombras */
  --shadow-sm: 0 2px 5px rgba(26, 10, 32, 0.08);
  --shadow-md: 0 6px 16px rgba(88, 35, 109, 0.25);
  --shadow-lg: 0 10px 30px rgba(88, 35, 109, 0.08);
  --shadow-xl: 0 15px 40px rgba(23, 4, 33, 0.18);
  --shadow-2xl: 0 18px 45px rgba(88, 35, 109, 0.25);
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 14px;
  --radius-2xl: 16px;
  --radius-3xl: 18px;
  --radius-pill: 999px;
  
  /* Espaçamentos (baseado em 4px) */
  --spacing-0: 0;
  --spacing-1: 0.25rem;   /* 4px */
  --spacing-2: 0.5rem;    /* 8px */
  --spacing-3: 0.75rem;   /* 12px */
  --spacing-4: 1rem;      /* 16px */
  --spacing-5: 1.25rem;   /* 20px */
  --spacing-6: 1.5rem;    /* 24px */
  --spacing-8: 2rem;      /* 32px */
  --spacing-10: 2.5rem;   /* 40px */
  --spacing-12: 3rem;     /* 48px */
  --spacing-16: 4rem;     /* 64px */
  
  /* Tipografia */
  --font-family: "Quicksand", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.8rem;     /* 12.8px */
  --font-size-base: 0.9rem;   /* 14.4px */
  --font-size-md: 0.92rem;    /* 14.72px */
  --font-size-lg: 1rem;       /* 16px */
  --font-size-xl: 1.1rem;     /* 17.6px */
  --font-size-2xl: 1.4rem;    /* 22.4px */
  --font-size-3xl: 2rem;      /* 32px */
  --font-size-4xl: 2.1rem;    /* 33.6px */
  
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  
  /* Transições */
  --transition-fast: 0.08s ease;
  --transition-base: 0.12s ease;
  --transition-slow: 0.15s ease;
  --transition-slower: 0.2s ease;
  
  /* Z-index */
  --z-dropdown: 10;
  --z-sticky: 20;
  --z-modal: 30;
  --z-tooltip: 40;
  
  /* Larguras Máximas */
  --max-width-sm: 640px;
  --max-width-md: 768px;
  --max-width-lg: 1024px;
  --max-width-xl: 1200px;
  --max-width-2xl: 1400px;
  
  /* Aliases para compatibilidade com novos componentes */
  --text-primary: var(--femme-text);
  --text-secondary: var(--femme-text-light);
  --text-muted: var(--femme-text-muted);
  --surface: var(--femme-bg-card);
  --surface-2: var(--femme-bg-alt);
  --border-color: var(--femme-border);
  --brand: var(--femme-purple);
  --brand-accent: var(--femme-purple-soft);
  --brand-soft: rgba(88, 35, 109, 0.1);
  --error: var(--femme-danger);
  --success: var(--femme-success);
  --warning: var(--femme-warning);
  
  /* Aliases para página de métricas (legado) */
  --color-text-primary: var(--femme-text);
  --color-text-secondary: var(--femme-text-light);
  --color-border: var(--femme-border);
  --color-primary: var(--femme-purple);
  --color-background-secondary: var(--femme-bg-alt);
}

/* ========================================
   2. RESET CSS
   ======================================== */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--femme-text);
  background-color: var(--femme-bg);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

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

ul,
ol {
  list-style: none;
}

/* ========================================
   3. TIPOGRAFIA BASE
   ======================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--femme-purple);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-md); }
h6 { font-size: var(--font-size-base); }

p {
  margin-bottom: var(--spacing-4);
}

small {
  font-size: var(--font-size-sm);
}

strong {
  font-weight: var(--font-weight-semibold);
}

/* ========================================
   4. CLASSES UTILITÁRIAS
   ======================================== */

/* Display */
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none !important; }
.is-hidden { display: none !important; }

/* Flexbox */
.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }

/* Grid */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Gap */
.gap-1 { gap: var(--spacing-1); }
.gap-2 { gap: var(--spacing-2); }
.gap-3 { gap: var(--spacing-3); }
.gap-4 { gap: var(--spacing-4); }
.gap-5 { gap: var(--spacing-5); }
.gap-6 { gap: var(--spacing-6); }
.gap-8 { gap: var(--spacing-8); }

/* Padding */
.p-0 { padding: var(--spacing-0); }
.p-2 { padding: var(--spacing-2); }
.p-4 { padding: var(--spacing-4); }
.p-6 { padding: var(--spacing-6); }
.px-4 { padding-left: var(--spacing-4); padding-right: var(--spacing-4); }
.py-2 { padding-top: var(--spacing-2); padding-bottom: var(--spacing-2); }
.py-4 { padding-top: var(--spacing-4); padding-bottom: var(--spacing-4); }

/* Margin */
.m-0 { margin: var(--spacing-0); }
.m-auto { margin: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-2 { margin-bottom: var(--spacing-2); }
.mb-4 { margin-bottom: var(--spacing-4); }
.mb-6 { margin-bottom: var(--spacing-6); }

/* Width */
.w-full { width: 100%; }
.w-auto { width: auto; }
.max-w-xl { max-width: var(--max-width-xl); }

/* Height */
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Font Weight */
.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

/* Font Size */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }

/* Colors */
.text-purple { color: var(--femme-purple); }
.text-muted { color: var(--femme-text-muted); }
.text-white { color: #ffffff; }
.bg-white { background-color: #ffffff; }
.bg-purple { background-color: var(--femme-purple); }

/* Border Radius */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-pill); }

/* Shadow */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-y-auto { overflow-y: auto; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Transition */
.transition { transition: all var(--transition-base); }
.transition-fast { transition: all var(--transition-fast); }

/* ========================================
   5. BREAKPOINTS RESPONSIVOS
   ======================================== */

/* Mobile First Approach */

/* Small devices (landscape phones, 640px and up) */
@media (min-width: 640px) {
  .sm\:block { display: block; }
  .sm\:flex { display: flex; }
  .sm\:hidden { display: none; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
  .md\:block { display: block; }
  .md\:flex { display: flex; }
  .md\:hidden { display: none; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Large devices (desktops, 1024px and up) */
@media (min-width: 1024px) {
  .lg\:block { display: block; }
  .lg\:flex { display: flex; }
  .lg\:hidden { display: none; }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Extra large devices (large desktops, 1280px and up) */
@media (min-width: 1280px) {
  .xl\:block { display: block; }
  .xl\:hidden { display: none; }
}

/* ========================================
   6. HELPERS
   ======================================== */

.container {
  width: 100%;
  max-width: var(--max-width-xl);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--spacing-5);
  padding-right: var(--spacing-5);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Scrollbar customizado (opcional) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--femme-purple-soft);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--femme-purple);
}
