/* ===== LAYOUT MODERNO - SISTEMA SABRINA SANTOS ===== */

/* Variáveis CSS para temas */
:root {
  --primary-color: #7b4bff;
  --primary-hover: #6a3ff0;
  --secondary-color: #6366f1;
  --accent-color: #f59e0b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-sidebar: #ffffff;
  --bg-navbar: #ffffff;
  --bg-footer: #1e293b;
  
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;
  
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --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.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 280px;
  --navbar-height: 70px;
}

/* Tema Escuro */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-sidebar: #1e293b;
  --bg-navbar: #1e293b;
  --bg-footer: #0f172a;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --text-inverse: #0f172a;
  
  --border-color: #334155;
  --border-light: #475569;
}

/* Reset e Base */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== NAVBAR PRINCIPAL ===== */
.main-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  background-color: var(--bg-navbar);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .main-navbar {
  background-color: rgba(30, 41, 59, 0.95);
}

.navbar-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

/* Logo e Marca */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: var(--radius-lg);
  color: white;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Menu de Navegação */
.navbar-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  justify-content: center;
}

.navbar-user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: var(--transition);
  font-weight: 500;
  position: relative;
}

.nav-item:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

.nav-item.active {
  color: var(--primary-color);
  background-color: rgba(123, 75, 255, 0.1);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-text {
  font-size: 0.875rem;
}

/* Ações da Navbar */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background-color: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.action-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.action-btn svg {
  width: 20px;
  height: 20px;
}

/* Toggle de Tema */
.theme-toggle .icon-sun {
  display: none;
}

.theme-toggle .icon-moon {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

/* Menu Mobile */
.mobile-menu-toggle .icon-close {
  display: none;
}

.mobile-menu-toggle[aria-expanded="true"] .icon-menu {
  display: none;
}

.mobile-menu-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

/* Overlay Mobile */
.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.mobile-overlay[hidden] {
  display: none;
}

/* ===== CONTEÚDO PRINCIPAL ===== */
.main-content {
  margin-top: var(--navbar-height);
  min-height: calc(100vh - var(--navbar-height));
}

.app-layout {
  display: flex;
  min-height: calc(100vh - var(--navbar-height));
}

/* ===== SIDEBAR ===== */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--navbar-height);
  height: calc(100vh - var(--navbar-height));
  overflow-y: auto;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

/* Estados da Sidebar */
.app-sidebar.collapsed {
  width: 70px;
}

.app-sidebar.collapsed .nav-text,
.app-sidebar.collapsed .nav-badge,
.app-sidebar.collapsed .sidebar-user-info,
.app-sidebar.collapsed .nav-section-title,
.app-sidebar.collapsed .credits-display,
.app-sidebar.collapsed .credits-label {
  display: none;
}

.app-sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 0.75rem;
}

.app-sidebar.collapsed .nav-icon {
  width: 24px;
  height: 24px;
}

.app-sidebar.collapsed .sidebar-footer {
  padding: 1rem 0.5rem;
}

.app-sidebar.collapsed .sidebar-actions {
  justify-content: center;
}

/* Sidebar Mobile */
.app-sidebar.mobile {
  position: fixed;
  left: -100%;
  top: var(--navbar-height);
  width: 100%;
  z-index: 998;
  transition: left 0.3s ease;
}

.app-sidebar.mobile.open {
  left: 0;
}

/* Body com sidebar colapsada */
body.sidebar-collapsed .content-area {
  margin-left: 70px;
}

/* Cabeçalho da Sidebar */
.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.brand-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1rem;
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Navegação da Sidebar */
.sidebar-navigation {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 1.5rem;
}

.nav-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 1.5rem 0.75rem;
}

.nav-items {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  color: var(--text-secondary);
  transition: var(--transition);
  position: relative;
  font-size: 0.875rem;
  font-weight: 500;
}

.nav-item:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

.nav-item.active {
  color: var(--primary-color);
  background-color: rgba(123, 75, 255, 0.1);
  border-right: 3px solid var(--primary-color);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: var(--primary-color);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-text {
  flex: 1;
}

.nav-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
}

.credits-badge {
  background-color: var(--accent-color);
  color: white;
}

.admin-badge {
  background-color: var(--primary-color);
  color: white;
  font-size: 0.625rem;
  padding: 0.25rem 0.5rem;
}

/* Rodapé da Sidebar */
.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  background-color: var(--bg-secondary);
}

.credits-display {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.credits-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-color), #fbbf24);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.credits-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.credits-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.credits-amount {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar-actions {
  display: flex;
  justify-content: flex-end;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-toggle:hover {
  background-color: var(--border-color);
  color: var(--text-primary);
}

/* ===== ÁREA DE CONTEÚDO ===== */
.content-area {
  flex: 1;
  width: 100%;
  max-width: none;
  padding: 2rem;
  background-color: var(--bg-secondary);
  min-height: calc(100vh - var(--navbar-height));
  box-sizing: border-box;
}

/* Garante que o content-area ocupe toda a largura disponível */
.app-layout {
  display: flex;
  min-height: calc(100vh - var(--navbar-height));
  width: 100%;
}

/* Ajusta o layout quando a sidebar está colapsada */
body.sidebar-collapsed .content-area {
  margin-left: 70px;
  width: calc(100% - 70px);
}

/* Em dispositivos móveis, o content-area ocupa toda a largura */
@media (max-width: 768px) {
  .content-area {
    margin-left: 0;
    width: 100%;
    padding: 1rem;
  }
  
  body.sidebar-collapsed .content-area {
    margin-left: 0;
    width: 100%;
  }
}

/* Garante que o conteúdo interno se expanda adequadamente */
.content-area > * {
  width: 100%;
  max-width: none;
}

/* Container responsivo para o conteúdo */
.content-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Para conteúdo que deve ocupar toda a largura */
.content-full-width {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding-left: 2rem;
  padding-right: 2rem;
  box-sizing: border-box;
}

/* Ajustes para diferentes tamanhos de tela */
@media (min-width: 1200px) {
  .content-area {
    padding: 2.5rem;
  }
}

@media (min-width: 1600px) {
  .content-area {
    padding: 3rem;
  }
}

/* ===== FOOTER ===== */
.app-footer {
  background-color: var(--bg-footer);
  color: var(--text-inverse);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 1.5rem 1.5rem;
}

/* Seção Principal do Footer */
.footer-main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section {
  display: flex;
  flex-direction: column;
}

.footer-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-inverse);
  margin: 0 0 1rem 0;
}

.footer-description {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.footer-brand-name {
  font-weight: 600;
  color: var(--text-inverse);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
  font-size: 0.875rem;
}

.footer-links a:hover {
  color: var(--text-inverse);
}

/* Divisor do Footer */
.footer-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 2rem 0;
}

/* Seção Inferior do Footer */
.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-copyright p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-legal a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: var(--transition);
}

.footer-legal a:hover {
  color: var(--text-inverse);
}

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

.footer-social {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: var(--bg-tertiary);
  color: var(--text-muted);
  border-radius: var(--radius-md);
  transition: var(--transition);
  text-decoration: none;
}

.social-link:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 1024px) {
  .navbar-menu {
    display: none;
  }
  
  .navbar-container {
    padding: 0 1rem;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 100%;
    --navbar-height: 60px;
  }
  
  .app-sidebar {
    position: fixed;
    left: -100%;
    top: var(--navbar-height);
    width: 100%;
    z-index: 998;
    transition: left 0.3s ease;
  }
  
  .app-sidebar.open {
    left: 0;
  }
  
  .content-area {
    padding: 1rem;
  }
  
  .footer-main {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
  }
  
  .navbar-brand .brand-tagline {
    display: none;
  }
  
  .brand-name {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .navbar-container {
    padding: 0 0.75rem;
    gap: 1rem;
  }
  
  .content-area {
    padding: 0.75rem;
  }
  
  .footer-container {
    padding: 2rem 1rem 1rem;
  }
}

/* ===== ANIMAÇÕES ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.app-sidebar,
.content-area,
.app-footer {
  animation: fadeIn 0.3s ease-out;
}

/* Animações de entrada */
.animate-in {
  animation: scaleIn 0.4s ease-out;
}

/* Transições suaves */
.app-sidebar,
.nav-item,
.action-btn,
.social-link {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover effects */
.nav-item:hover {
  transform: translateX(4px);
}

.action-btn:hover {
  transform: scale(1.05);
}

.social-link:hover {
  transform: translateY(-2px) scale(1.1);
}

/* Estados ativos */
.nav-item.active {
  transform: translateX(0);
}

.nav-item.active::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 2px 0 0 2px;
}

/* ===== UTILITÁRIOS ===== */
.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;
}

/* ===== ESTADOS DE CARREGAMENTO ===== */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
} 