/* Bandeirante Intranet - Main Styles */

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

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ===== SIDEBAR NAV ITEMS ===== */
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  color: #93c5fd;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  user-select: none;
}

.nav-item:hover {
  background: rgba(255,255,255,0.1);
  color: #ffffff;
}

.nav-item.active {
  background: rgba(255,255,255,0.15);
  color: #ffffff;
  font-weight: 600;
}

.nav-item.active i { color: #F2C230; }

/* ===== QUICK LINKS ===== */
.quick-link-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.25rem;
  border-radius: 0.5rem;
  color: #93c5fd;
  font-size: 0.625rem;
  text-decoration: none;
  transition: all 0.15s ease;
}

.quick-link-item:hover {
  background: rgba(255,255,255,0.1);
  color: #ffffff;
}

.quick-link-item i { font-size: 0.875rem; }

/* ===== BADGES ===== */
.badge-new {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #D61C1C;
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  min-width: 1.125rem;
  height: 1.125rem;
  border-radius: 999px;
  padding: 0 0.25rem;
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1E63C5;
  color: white;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  font-size: 0.875rem;
}

.btn-primary:hover { background: #1a56b0; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(30,99,197,0.3); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #F3F4F6;
  color: #374151;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #E5E7EB;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.875rem;
}

.btn-secondary:hover { background: #E5E7EB; }

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #FEE2E2;
  color: #DC2626;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #FECACA;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.875rem;
}

.btn-danger:hover { background: #FECACA; }

/* ===== FORM INPUTS ===== */
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.25rem;
}

.form-input {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid #E5E7EB;
  border-radius: 0.75rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: white;
  color: #111827;
}

.form-input:focus {
  border-color: #1E63C5;
  box-shadow: 0 0 0 3px rgba(30,99,197,0.15);
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.15s ease;
}

.modal-overlay.hidden { display: none; }

.modal-box {
  background: white;
  border-radius: 1.25rem;
  padding: 1.5rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: slideUp 0.2s ease;
  position: relative;
}

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

/* ===== SECTION TRANSITIONS ===== */
.section-content {
  animation: fadeIn 0.2s ease;
}

/* ===== TOAST ===== */
.toast {
  background: white;
  border-radius: 0.875rem;
  padding: 0.75rem 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 240px;
  max-width: 340px;
  border-left: 3px solid;
  pointer-events: all;
  animation: slideLeft 0.25s ease;
}

@keyframes slideLeft { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.toast.success { border-color: #10B981; }
.toast.success i { color: #10B981; }
.toast.error { border-color: #DC2626; }
.toast.error i { color: #DC2626; }
.toast.info { border-color: #1E63C5; }
.toast.info i { color: #1E63C5; }
.toast.warning { border-color: #F59E0B; }
.toast.warning i { color: #F59E0B; }

/* ===== CARDS ===== */
.post-card {
  background: white;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid #F3F4F6;
  transition: all 0.2s ease;
  cursor: pointer;
}

.post-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.08); transform: translateY(-2px); }

.post-card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: linear-gradient(135deg, #0B2B57, #1E63C5);
}

/* ===== NEWS FEED ITEMS ===== */
.feed-item {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  cursor: pointer;
  transition: background 0.1s;
}

.feed-item:hover { background: #F9FAFB; }

/* ===== CHAT ===== */
.message-bubble {
  max-width: 75%;
  padding: 0.5rem 0.875rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  word-break: break-word;
}

.message-bubble.mine {
  background: #1E63C5;
  color: white;
  border-bottom-right-radius: 0.25rem;
  margin-left: auto;
}

.message-bubble.other {
  background: white;
  color: #111827;
  border-bottom-left-radius: 0.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.message-group { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.5rem; }
.message-group.mine { align-items: flex-end; }
.message-group.other { align-items: flex-start; }

.message-time {
  font-size: 0.6875rem;
  color: #9CA3AF;
  padding: 0 0.25rem;
}

/* ===== KANBAN / STATUS CHIPS ===== */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-aberta { background: #DBEAFE; color: #1D4ED8; }
.status-em_andamento { background: #FEF3C7; color: #B45309; }
.status-concluida { background: #D1FAE5; color: #065F46; }
.status-cancelada { background: #F3F4F6; color: #6B7280; }

/* Post tipo badges */
.tipo-noticia { background: #DBEAFE; color: #1D4ED8; }
.tipo-comunicado { background: #EDE9FE; color: #5B21B6; }
.tipo-urgente { background: #FEE2E2; color: #DC2626; }
.tipo-ti { background: #D1FAE5; color: #065F46; }
.tipo-rh { background: #FCE7F3; color: #9D174D; }
.tipo-campanha { background: #FEF3C7; color: #B45309; }
.tipo-operacional { background: #F3F4F6; color: #374151; }
.tipo-marketing { background: #FFF7ED; color: #C2410C; }

/* Priority */
.prioridade-urgente { background: #FEE2E2; color: #DC2626; }
.prioridade-alta { background: #FEF3C7; color: #B45309; }
.prioridade-normal { background: #F3F4F6; color: #6B7280; }

/* ===== CANAIS ===== */
.canal-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.875rem;
  cursor: pointer;
  border-radius: 0.5rem;
  transition: background 0.1s;
  margin: 0.125rem 0.5rem;
}

.canal-item:hover { background: #F3F4F6; }
.canal-item.active { background: #EFF6FF; color: #1E63C5; font-weight: 600; }

/* ===== CONVERSA ITEM ===== */
.conversa-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid #F9FAFB;
}

.conversa-item:hover { background: #F9FAFB; }
.conversa-item.active { background: #EFF6FF; border-left: 3px solid #1E63C5; }

/* ===== DIRETÓRIO ===== */
.dir-card {
  background: white;
  border-radius: 1rem;
  padding: 1.25rem;
  border: 1px solid #F3F4F6;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dir-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.08); transform: translateY(-2px); }

/* ===== DOCUMENT ITEMS ===== */
.doc-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  cursor: pointer;
  transition: background 0.1s;
}

.doc-item:hover { background: #F9FAFB; }

/* ===== EDITOR ===== */
#post-conteudo:empty:before {
  content: attr(placeholder);
  color: #9CA3AF;
  pointer-events: none;
}

.editor-btn {
  padding: 0.375rem 0.5rem;
  border-radius: 0.375rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #6B7280;
  font-size: 0.75rem;
  transition: all 0.1s;
}

.editor-btn:hover { background: #E5E7EB; color: #111827; }

/* ===== REACTION BUTTONS ===== */
.reacao-btn {
  font-size: 1.1rem;
  padding: 0.25rem 0.375rem;
  border-radius: 0.5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.1s;
  line-height: 1;
}

.reacao-btn:hover { background: #F3F4F6; transform: scale(1.2); }
.reacao-btn.active { background: #EFF6FF; }

/* ===== AGENDA CALENDAR ===== */
.cal-day {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.1s;
}

.cal-day:hover { background: #EFF6FF; color: #1E63C5; }
.cal-day.today { background: #1E63C5; color: white; font-weight: 700; }
.cal-day.has-event { position: relative; font-weight: 600; color: #1E63C5; }
.cal-day.has-event::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: #1E63C5;
  border-radius: 50%;
}

/* ===== ADMIN TABS ===== */
.admin-tab {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #6B7280;
  font-weight: 500;
  transition: all 0.15s;
}

.admin-tab:hover { color: #1E63C5; }
.admin-tab.active { background: #1E63C5; color: white; font-weight: 600; }

/* ===== SOLIC TABS ===== */
.solic-tab {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #6B7280;
  font-weight: 500;
  transition: all 0.15s;
}

.solic-tab.active { background: #1E63C5; color: white; font-weight: 600; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }

/* ===== NOTIF PANEL ===== */
.notif-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.1s;
}

.notif-item:hover { background: #F9FAFB; }
.notif-item.unread { background: #EFF6FF; }

/* ===== SERVICOS TI ===== */
.service-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.service-operacional { background: #10B981; }
.service-degradado { background: #F59E0B; }
.service-inoperante { background: #DC2626; }
.service-manutencao { background: #6B7280; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    left: -16rem;
    top: 0;
    bottom: 0;
    z-index: 40;
    transition: left 0.3s ease;
  }
  
  #sidebar.open { left: 0; }
  
  .modal-box { padding: 1rem; }

  /* ===== CHAT MOBILE ===== */
  .chat-layout {
    position: relative;
    overflow: hidden;
  }

  /* Sidebar de conversas: tela cheia no mobile */
  .chat-sidebar {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 100% !important;
    z-index: 2;
    transition: transform 0.3s ease;
  }

  /* Quando conversa está aberta, esconde a sidebar */
  .chat-sidebar.chat-sidebar-hidden {
    transform: translateX(-100%);
    pointer-events: none;
  }

  /* Área de chat: tela cheia - só aparece em frente quando conversa está ativa */
  #chat-area {
    position: absolute;
    left: 0; top: 0; right: 0; bottom: 0;
    z-index: 1; /* atrás da sidebar por padrão */
    transition: z-index 0s;
  }

  /* Quando uma conversa está aberta, chat-area fica na frente */
  #chat-area.chat-area-active {
    z-index: 3;
  }

  /* Mensagens: padding menor */
  .message-group { padding: 0 0.5rem; }
  .message-bubble { max-width: 85% !important; }

  /* Input de mensagem: maior para toque */
  #chat-input { font-size: 16px !important; } /* evita zoom no iOS */

  /* Emoji picker: ajustar para mobile */
  #emoji-picker { width: calc(100vw - 2rem) !important; left: 0 !important; }

  /* Canal chat mobile */
  #section-canais .flex {
    flex-direction: column;
  }
  #section-canais .w-64 {
    width: 100% !important;
    max-height: 200px;
    border-right: none !important;
    border-bottom: 1px solid #E5E7EB;
  }
}

/* ===== ANIMATIONS ===== */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.pulse { animation: pulse-dot 2s infinite; }

/* ===== TYPING INDICATOR ===== */
.typing-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #9CA3AF;
  border-radius: 50%;
  animation: typing 1.2s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-4px); opacity: 1; }
}

/* ===== UPLOAD ZONE ===== */
.upload-zone {
  border: 2px dashed #D1D5DB;
  border-radius: 0.75rem;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: #1E63C5;
  background: #EFF6FF;
}

/* ===== NOTIFICATION BADGE PULSE ===== */
@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(214,28,28,0.4); }
  50% { box-shadow: 0 0 0 4px rgba(214,28,28,0); }
}

#notif-badge:not(.hidden) { animation: badge-pulse 2s infinite; }

/* ===== IMAGE GALLERY ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.gallery-item {
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: opacity 0.15s;
}

.gallery-item:hover { opacity: 0.85; }

/* ===== FOLDER CARDS ===== */
.pasta-card {
  background: white;
  border-radius: 0.875rem;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  border: 1px solid #F3F4F6;
  transition: all 0.15s;
}

.pasta-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); border-color: #DBEAFE; }
.pasta-card.active { border-color: #1E63C5; background: #EFF6FF; }

/* ===== SURVEY OPTION ===== */
.survey-option {
  position: relative;
  overflow: hidden;
  border: 1.5px solid #E5E7EB;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: all 0.15s;
}

.survey-option:hover { border-color: #1E63C5; background: #EFF6FF; }
.survey-option.selected { border-color: #1E63C5; background: #EFF6FF; }
.survey-option .progress-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: rgba(30,99,197,0.1);
  transition: width 0.6s ease;
  z-index: 0;
}

.survey-option .option-content { position: relative; z-index: 1; }

/* ===== AVATAR INITIALS ===== */
.avatar-auto {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

/* Print styles */
@media print {
  #sidebar, header, .btn-primary, .btn-secondary { display: none !important; }
  #main-content { margin: 0; padding: 1rem; }
}
