/* =========================================================
   1. RESET & VARIÁVEIS GERAIS (SISTEMA DE TEMAS)
   ========================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Helvetica, Arial, sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Roboto;
}

:root {
  /* Cores - Modo Claro */
  --bg-body: #f9fafb;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --text-main: #000000;
  --text-muted: #555555;
  --border-color: #dddddd;
  --border-color-soft: #eeeeee;
  --primary-color: #8b5cf6;
  
  --btn-bg: #000000;
  --btn-text: #ffffff;
  --btn-secondary-bg: #eeeeee;
  --danger: #e60000;
  --hover-bg: #f3f4f6;

  /* Dimensões globais */
  --radius-sm: 3px;
  --radius-md: 5px;
  --radius-lg: 8px;
  --shadow-sm: 0 4px 8px rgba(0,0,0,.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Tipografia */
  --fs-xxs: 10px;
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-md: 14px;
  --fs-lg: 15px;
  --fs-xl: 20px;
  
  --card-w: 100px;
  --thumb-h: 180px;
}

/* Cores - Modo Escuro */
[data-theme="dark"] {
  --bg-body: #000000;
  --bg-card: #121212;
  --bg-input: #262626;
  --text-main: #ffffff;
  --text-muted: #aaaaaa;
  --border-color: #262626;
  --border-color-soft: #1a1a1a;
  
  --btn-bg: #ffffff;
  --btn-text: #000000;
  --btn-secondary-bg: #333333;
  --hover-bg: #222222;
  --shadow-sm: 0 4px 8px rgba(255,255,255,.02);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

html, body {
  background-color: var(--bg-body);
  color: var(--text-main);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Utilitários */
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; height: auto; }
.hidden { display: none !important; }

/* =========================================================
   2. LAYOUT BÁSICO
   ========================================================= */
#container {
  max-width: 640px;
  width: 100%;
  margin: 20px auto;
  max-height: 100vh;
}

.bg-image {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  z-index: -1;
}

/* =========================================================
   3. HEADER / NAV (Topo)
   ========================================================= */
.minimal-header {
  max-width: 1050px;
  display: flex;
  margin: 0 auto;
  justify-content: space-between;
  align-items: center;
  padding: 0px 24px;
  top: 0;
  z-index: 1000;
}



.header-left { margin-left: 30px;}
.header-right { margin-right: 30px; }
.header-center { display: flex; gap: 30px; align-items: center; flex: 1; justify-content: center; padding: 5px;}
.header-center a { padding: 5px 25px; color: var(--text-main); }
.header-center a:hover { background-color: var(--hover-bg); border-radius: 10px;}
     .minimal-header .header-icon{
     font-size:25px;}





/* Regras aplicadas APENAS em telas com até 768px de largura (Mobile/Tablets pequenos) */
@media screen and (max-width: 768px) {
  .minimal-header {
    padding: 0px;
  }
  .header-right{
      margin-right:10px;
  }
  .header-left{
      margin-left:10px;
  }
}




@media screen and (max-width: 768px) {

  /* 2. Ajuste do tamanho e posição da caixa do menu */
  .custom-dropdown-menu {
    width: 90vw; /* Ocupa quase toda a largura da tela */
    max-width: 320px; /* Limite máximo para não ficar gigante em tablets */
    margin-top: 15px !important; /* Descola um pouco do header */
    
    /* Força o menu a não vazar da tela pela direita */
    right: 0 !important; 
    left: auto !important; 
    
    /* Opcional: bordas mais arredondadas e sombra suave */
    border-radius: 12px;
    box-shadow: 0px 8px 24px rgba(0, 0, 0, 0.15);
  }

  /* 3. Ajuste dos itens do menu (Links) - Foco em Touchscreen */
  .custom-dropdown-item {
    padding: 14px 20px; /* Aumenta o padding para o dedo não errar o clique */
    font-size: 16px; /* Tamanho de fonte ideal para leitura mobile */
    display: flex;
    align-items: center; /* Alinha o ícone e o texto perfeitamente */
  }

  /* 4. Espaçamento dos ícones dentro do menu */
  .custom-dropdown-item i {
    font-size: 1.25rem; /* Ícone um pouco maior */
    margin-right: 12px; /* Espaço entre o ícone e o texto */
  }

  /* 5. Espaçamento da linha divisória */
  .custom-divider {
    margin: 8px 0;
  }
}








/* Ícones ativos na Navbar */
.sidebar__icon-active { display: none; }
.sidebar__link.active-link .sidebar__icon-active { display: inline-block; color: var(--text-main);}
.sidebar__link.active-link .sidebar__icon-inactive { display: none; }
.active-link { backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }

/* Ícone de perfil no header */
.header-icon-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  color: var(--text-muted); 
}
.header-icon-btn:hover, .header-icon-btn[aria-expanded="true"] {
  background-color: var(--hover-bg); 
  color: var(--text-main); 
}
.header-icon-btn i { font-size: 22px; }

/* =========================================================
   4. DROPDOWN DO USUÁRIO (Menu)
   ========================================================= */
.custom-dropdown-menu {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 8px;
  min-width: 220px;
  margin-top: 50px !important;
  background-color: var(--bg-card);
  border-top: 3px solid #3b82f6;
}

.custom-dropdown-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; font-size: 14px; font-weight: 500;
  color: var(--text-main); border-radius: 8px;
  transition: all 0.2s ease; text-decoration: none; background: transparent; border: none; width: 100%;
}
.custom-dropdown-item:hover { background-color: var(--hover-bg); }
.custom-dropdown-item i { font-size: 22px; color: var(--text-main); transition: color 0.2s; }

.custom-dropdown-item.danger-item:hover { background-color: rgba(239, 68, 68, 0.1); color: #ef4444; }
.custom-dropdown-item.danger-item:hover i { color: #ef4444; }

.custom-divider { margin: 6px 0; border-top: 1px solid var(--border-color); }

.dropdown-menu.show { animation: slideDownFade 0.2s ease forwards; }
@keyframes slideDownFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================================
   5. BOTÕES PADRÕES
   ========================================================= */
.btn { border: none; border-radius: var(--radius-sm); padding: 6px 15px; font-size: var(--fs-sm); cursor: pointer; }
.btn-primary { background: var(--btn-bg); color: var(--btn-text); }
.btn-secondary { background: var(--btn-secondary-bg); color: var(--text-main); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-login { background: var(--btn-bg); color: var(--btn-text); padding: 6px 16px; border-radius: 4px; font-size: 14px; font-weight: 500; }

.suggestion-mobile .btn-ac, .accept { background: var(--btn-bg); color: var(--btn-text); border: none; border-radius: var(--radius-sm); padding: 6px 15px; font-size: var(--fs-sm); cursor: pointer; }
.suggestion-mobile .btn-not, .cancel, .btn-follow { background: var(--btn-secondary-bg); color: var(--text-main); border: none; border-radius: var(--radius-sm); padding: 5px 14px; font-size: var(--fs-sm); cursor: pointer;}
.btn-follow:hover { background: var(--border-color); }
.btn-follow2 { background: var(--btn-bg); color: var(--btn-text); border: none; border-radius: var(--radius-sm); padding: 5px 14px; font-size: var(--fs-sm); cursor: pointer; }
.btn-excluir { background: var(--danger); color: #fff; border: none; border-radius: var(--radius-sm); padding: 5px 14px; font-size: var(--fs-sm); font-weight: 500; cursor: pointer; }

/* =========================================================
   6. BUSCA (Threads / Instagram Style)
   ========================================================= */
.search-wrapper { position: relative; width: 95%; max-width: 600px; margin: 20px auto 30px auto; z-index: 500; }
.search-trigger { display: flex; align-items: center; background-color: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; padding: 12px 20px; cursor: pointer; transition: all 0.2s ease; color: var(--text-main); }
.search-trigger:hover { border-color: var(--primary-color); }
.search-trigger i { font-size: 18px; margin-right: 10px; color: var(--text-main); }
.search-trigger span { font-size: 14px; font-weight: 400; }

.search-dropdown { display: none; position: absolute; top: 110%; left: 0; width: 100%; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; box-shadow: var(--shadow-md); padding: 20px; flex-direction: column; gap: 15px; }
.search-dropdown.active { display: flex; }

.custom-select { width: 100%; padding: 12px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-input); font-size: 14px; color: var(--text-main); outline: none; }
.custom-select:focus { border-color: var(--primary-color); }

.btn-search-action { background-color: var(--btn-bg); color: var(--btn-text); border: none; padding: 12px; border-radius: 8px; font-weight: bold; cursor: pointer; transition: background 0.2s; }
.btn-search-action:hover { opacity: 0.8; }

.overlay-search { display: none; position: fixed; inset: 0; z-index: 499; background: rgba(0,0,0,0.5); }
.overlay-search.active { display: block; }

/* =========================================================
   7. USUÁRIOS ONLINE (Avatar no Topo) E STORIES
   ========================================================= */
.responsive { display: flex; overflow-x: auto; gap: 12px; padding: 10px; scrollbar-width: none; }
.responsive::-webkit-scrollbar { display: none; }
.users { display: flex; flex-direction: column; align-items: center; min-width: 75px; text-align: center; }

.users .img { width: 80px; height: 80px; border-radius: 50%; position: relative; padding: 3px; border: 2px solid transparent; transition: all 0.3s; }
.users.is-vip .img { border-color: #ffd700; }
.users .img img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background: var(--border-color); }

.users .user-name { font-size: 11px; font-weight: 700; margin-top: 5px; color: var(--text-main); display: block; white-space: nowrap; }
.users .user-category { font-size: 10px; color: var(--text-muted); display: block; margin-top: -2px; }

.online-dot { position: absolute; bottom: 2px; right: 5px; width: 12px; height: 12px; background-color: #44db44; border: 2px solid var(--bg-card); border-radius: 50%; z-index: 2; animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(68, 219, 68, 0.7); } 70% { transform: scale(1.2); box-shadow: 0 0 0 8px rgba(68, 219, 68, 0); } 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(68, 219, 68, 0); } }

/* Shorts/Stories Cards */
.shorts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--card-w), 1fr)); gap: 5px; margin-top: 20px; padding: 0 10px; }
.short-card { width: 100%; transition: transform 0.2s ease-in-out; cursor: pointer; }
.short-card:hover { transform: scale(1.05); }
.thumb { width: 100%; height: var(--thumb-h); border-radius: 12px; overflow: hidden; display: block; background: var(--bg-card); position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* =========================================================
   8. GRADE DE CATEGORIAS
   ========================================================= */

.card-categoria { position: relative; border-radius: 12px; overflow: hidden; text-decoration: none; box-shadow: var(--shadow-sm); transition: transform 0.2s ease; width: 100%; height: 100%; }
.card-categoria:hover { transform: scale(1.02); z-index: 10; }
.card-categoria img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-titulo { position: absolute; bottom: 0; left: 0; width: 100%; background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent); color: #fff; text-align: center; padding: 8px 0; font-weight: bold; text-transform: uppercase; font-size: 12px; text-shadow: 1px 1px 2px #000; pointer-events: none; }



/* =========================================================
   9. POSTS DE ANÚNCIO (Feed)
   ========================================================= */
.post { background: var(--bg-card); position: relative; border: 1px solid var(--border-color); border-radius: 8px; width: 100%; max-width: 650px; margin: 20px auto; overflow: hidden; box-shadow: var(--shadow-sm); }
.post-header { display: flex; align-items: center; padding: 12px; height: 70px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; margin-right: 10px; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-info .name { font-weight: bold; font-size: 15px; margin: 0; color: var(--text-main); }
.user-info .time { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

.post-caption { padding: 0 15px 10px 15px; font-size: 0.95rem; line-height: 1.4; color: var(--text-main); }
.post-images img { width: 100%; height: 250px; object-fit: cover; display: block; }
.post-footer { padding: 10px 15px; display: flex; justify-content: space-between; background-color: var(--bg-card); border-top: 1px solid var(--border-color); color: var(--text-muted); font-size: 13px; }

/* Truncar Texto - Ver Mais */
.text-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.text-expanded { display: block; word-break: break-word; }
.btn-ver-mais { color: var(--text-muted); cursor: pointer; font-size: 13px; font-weight: 600; display: none; margin-top: 5px; user-select: none; }
.btn-ver-mais:hover { color: var(--text-main); text-decoration: underline; }

@media (max-width: 600px) {
  .post-images img { height: 220px !important; object-fit: cover; }
  .post-images .owl-stage-outer { height: 220px !important; }
}

/* =========================================================
   10. MODAL DE STORIES (TELA CHEIA)
   ========================================================= */
.story-modal { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.95); z-index: 9999; justify-content: center; align-items: center; }
.story-modal.active { display: flex; }
.story-view { width: 100%; max-width: 450px; height: 80%; position: relative; overflow: hidden; display: none; background: #000; border-radius: 10px; }
.story-view img { width: 100%; height: 100%; object-fit: contain; }
.progress-bar { position: absolute; top: 10px; left: 10px; right: 10px; height: 3px; background: rgba(255,255,255,0.3); border-radius: 3px; z-index: 10; overflow: hidden; }
.progress-bar::after { content: ''; position: absolute; top: 0; left: 0; height: 100%; width: 0%; background: #fff; animation: progress 5s linear forwards; }
@keyframes progress { from { width: 0%; } to { width: 100%; } }
.click-left, .click-right { position: absolute; top: 0; width: 50%; height: 100%; z-index: 20; }
.click-left { left: 0; }
.click-right { right: 0; }
.close-story { position: absolute; top: 20px; right: 25px; background: none; border: none; color: white; font-size: 30px; cursor: pointer; z-index: 10000; }

/* =========================================================
   11. NOTIFICAÇÕES & MODAIS MENORES
   ========================================================= */
.notification-list { display: flex; flex-direction: column; gap: 10px; }
.notification-item { display: flex; align-items: center; gap: 2px; padding: 10px; }
.notification-item:hover { background: var(--hover-bg); cursor: pointer; border-radius: 8px; }
.notification-item img { width: 50px; height: 50px; object-fit: cover; border-radius: 50%; }
.notification-text { flex: 1; font-size: var(--fs-md); color: var(--text-main); }
.notification-text span { color: var(--text-muted); font-size: var(--fs-xs); }

.modal1 { position: fixed; left: 90px; top: 0; width: 100%; max-width: 350px; height: 100%; background: var(--bg-card); box-shadow: 0px 4px 8px rgba(0,0,0,.2); border-radius: 8px 8px 0 0; overflow-y: auto; z-index: 1000; display: none; animation: slideIn .4s ease-out; }
.modal-content1 { position: relative; padding: 10px 5px; }
.close-modal { position: absolute; top: 10px; right: 15px; font-size: 1.5rem; color: var(--text-main); cursor: pointer; font-weight: bold; }
@keyframes slideIn { from { transform: translateY(100%);} to { transform: translateY(0);} }
.modal-content1 h3 { text-align: center; font-weight: 600; font-size: 20px; color: var(--text-main); }

/* =========================================================
   12. PAGINAÇÃO E FOOTER MOBILE
   ========================================================= */
.pagination-container { margin-bottom: 60px; }
.pagination { display: flex; justify-content: center; margin-top: 15px; margin-bottom: 60px }
.pagination a, .pagination strong { display: inline-block; padding: 5px 10px; margin: 2px; text-decoration: none; color: var(--text-main); border: 1px solid var(--border-color); border-radius: 8px; }
.pagination strong { background: var(--text-main); color: var(--bg-card); border-color: var(--text-main); }
.pagination a:hover { background: var(--hover-bg); }

#footer-mobile { position: fixed; left: 0; bottom: 0; width: 100%; height: 50px; display: none; background: var(--bg-card); border-top: 1px solid var(--border-color); z-index: 1000; padding:10px 0; }
@media screen and (max-width: 1028px) {
  #footer-mobile { display: block; }
  #footer-mobile .footer-ul { list-style: none; display: flex; justify-content: space-around; align-items: center; height: 50px; }
  #footer-mobile ul { padding-left: 0px; }
  #footer-mobile .footer-ul .sidebar__link:hover { background: var(--bg-card); }
  .footer-ul i { font-size: 1.6rem; color: var(--text-main); }
  .footer-ul .sidebar__link { padding: 0; line-height: 40px; }
  .footer-container .footer-ul a { text-decoration: none; font-size: 25px; color: var(--text-muted); }
  .footer-icons .sidebar__link { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
  .icon-name { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
  .sidebar__icon-inactive, .sidebar__icon-active { font-size: 24px; color: var(--text-main); }
  .sidebar__link.active-link .icon-name { color: var(--text-main); }
}

@media screen and (max-width: 1020px) {
  .minimal-header { display: flex; justify-content: space-between; align-items: center; }
  .header-left { flex: 1; }
  .header-right { display: flex; justify-content: flex-end; gap: 20px; }
  .sidebar__link { display: none; }
  .header-center { flex: none; }
  .header-icon { font-size: 20px; }
  .icon-name { font-size: 10px; }
}

/* =========================================================
   13. ESTILOS EXCLUSIVOS DO HEADER / MENU DROPDOWN
   ========================================================= */

.header-icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    color: var(--text-muted, #374151); 
}

.header-icon-btn:hover, .header-icon-btn[aria-expanded="true"] {
    background-color: var(--hover-bg, #f3f4f6); 
    color: var(--text-main, #111827); 
}

.header-icon-btn i { font-size: 22px; }

.custom-dropdown-menu {
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 8px;
    min-width: 220px;
    margin-top: 50px !important;
    background-color: var(--bg-card, #ffffff);
    border-top: 3px solid #3b82f6;
}

.custom-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main, #000);
    border-radius: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
    background: transparent;
    border: none;
    width: 100%;
}

.custom-dropdown-item:hover { background-color: var(--hover-bg, #f3f4f6); }
.custom-dropdown-item i { font-size: 22px; color: var(--text-main, #000); transition: color 0.2s; }

.custom-dropdown-item.danger-item:hover {
    background-color: rgba(239, 68, 68, 0.1); 
    color: #ef4444; 
}

.custom-dropdown-item.danger-item:hover i { color: #ef4444; }
.custom-divider { margin: 6px 0; border-top: 1px solid var(--border-color, #f3f4f6); }

.dropdown-menu.show { animation: slideDownFade 0.2s ease forwards; }

@keyframes slideDownFade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}