.header, .nav-tabs, .tab-content {
  margin-left: 100px;
  margin-right: 30px;
}

[id^="cards-for-"]{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  grid-auto-rows: 1fr;
  margin-left: 12px;
  margin-right: 12px;
}

.card .card-img-top{
  width: 30px;
  height: 30px;
  object-fit: fill;
  border-radius: 10%;
  position: absolute;
  top: 15px;
  left: 15px;
  margin-left: 5px;
  margin-top: 15px;
}

.card-icon-top{
  width: 30px;
  height: 30px;
  border-radius: 10%;
  position: absolute;
  top: 15px;
  left: 15px;
  margin-left: 5px;
  margin-top: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon-top i{
  font-size: 18px;
  line-height: 1;
}

/* Additional styles if needed */
.card-img-top {
  width: 100%;
  height: auto;
}





.card-title{
  margin-top: 50px;
  align-content: left;
}
.card-text{
  font-size: 16px;
}

.card a {
  display: inline-flex;
  align-items: center;
  font-size: 16px;
  font-weight: bold;
  color: #006aff; /* Set the default link color */
  text-decoration: none; /* Remove underline */
  transition: all 0.3s ease; /* Smooth transition for hover effects */
  margin-top: 10px; /* Add some space between the link and content above */
}

.card a:hover {
  color: #004fc1; /* Change the color on hover */
  text-decoration: none; /* Add underline on hover */
}

.card a::after {
  content: '>'; /* Arrow icon after the link */
  display: inline-block;
  margin-left: 8px; /* Spacing between text and icon */
  transition: transform 0.3s ease; /* Smooth transition for the icon */
}

.card a:hover::after {
  transform: translateX(5px); /* Move the icon slightly to the right on hover */
}

/* =========================
   Personal Mode login gate (prettier warning card)
   ========================= */
.mode-login-gate {
  max-width: 860px;
  margin: 32px auto;
  padding: 16px;
}

.mode-login-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 18px;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
}

.mode-login-badge {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #fff;
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.25);
}

.mode-login-badge i {
  font-size: 20px;
}

.mode-login-title {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.2px;
  margin-bottom: 4px;
}

.mode-login-subtitle {
  opacity: 0.85;
  margin-bottom: 12px;
}

.mode-login-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.mode-login-hint {
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Night mode variant */
body.night-mode .mode-login-card {
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(17, 24, 39, 0.78);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.50);
}

body.night-mode .mode-login-title,
body.night-mode .mode-login-subtitle,
body.night-mode .mode-login-hint {
  color: rgba(255, 255, 255, 0.92);
}

body.night-mode .mode-login-subtitle,
body.night-mode .mode-login-hint {
  opacity: 0.78;
}

.cardscontent{
  margin:1rem 80px 0 80px ;
}

#cards-for-all{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  grid-auto-rows: 1fr;
}

.tab-content {
  padding: 1rem;
}

.tab-pane {
  display: none; /* Ensure all tab panes are hidden by default */
}

.tab-pane.show.active {
  display: block; /* Only the active tab pane should be visible */
}

/* Ensure each nav item takes up its space */
.nav-item {
  flex: 1; /* Allow each item to take equal space */
}

/* Tab navigation styles */
.nav-tabs .nav-link {
  white-space: nowrap;
  border-radius: .25rem; /* Rounded corners */
  margin-bottom: -1px; /* Adjust margin to align with bottom border */
  font-size: 16px;
  color: #000000; /* Tab text color */
  padding: .5rem 1rem; /* Padding for tabs */
  font-family: 'Poppins', sans-serif; /* Custom font */
  font-weight: bold; /* Bold text */
  transition: background-color 0.3s ease, color 0.3s ease; /* Smooth transition effects */
  background-color: none;
  padding-bottom: 10px; /* Create space for the line */
  text-align: center;
}

.nav-tabs .nav-item.show .nav-link, .nav-tabs .nav-link.active {
  background-color: transparent;
  border-color: transparent;
}
.nav-tabs .nav-link.active {
  position: relative;
  background: transparent;
  color: #0070fa;
  font-weight: 700;
  border: 0;
}
 
.nav-tabs .nav-link.active::after{
  content: "";
  position: absolute;
  background-color:#006aff;
  width: 100%;
  height: 4px;
  left: 0;
  bottom: 2px;
  border-radius: 20px;
}

/* Add space between tabs and cards */
#tabsContainer {
  margin-bottom: 2rem; /* Space below the tabs */
}

.nav-tabs{
  flex-wrap: nowrap;
  border: 0;
  overflow-y: hidden;
  font-family: 'Poppins', sans-serif;
}

/* When search results are active, display cards in a row */
.search-results-layout .card {
  display: inline-block;
  margin-right: 10px; /* Adjust as needed */
  overflow: hidden;
  margin-bottom: 1.5rem; /* Increase the bottom margin for more spacing */
  width: 350px; /* Adjust width as needed */
  height: 300px;
}

/* =========================
   FLOATING UI (Index)
   ========================= */

/* Mode toggle lives top-right */
.mode-toggle-container{
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 11;
}

/* Card search lives bottom-left */
.search-bar-container{
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 11;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* =========================
   MODE TOGGLE (Public | Personal)
   ========================= */
.mode-toggle{
  display:flex;
  align-items:center;
  gap:6px;
  padding:6px;
  border-radius: 14px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.10);
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mode-toggle .mode-btn{
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  opacity: 0.75;
}

.mode-toggle .mode-btn.active{
  opacity: 1;
  background: rgba(0,0,0,0.06);
}

body.night-mode .mode-toggle{
  background: rgba(17,25,40,0.92);
  border-color: rgba(255,255,255,0.14);
}

body.night-mode .mode-toggle .mode-btn{
  color: #fff;
}

body.night-mode .mode-toggle .mode-btn.active{
  background: rgba(255,255,255,0.12);
}

/* Search button (same vibe as tools.html AI Finder bubble) */
.card-search-fab{
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.card-search-fab:hover{
  transform: translateY(-1px);
  box-shadow: 0 18px 46px rgba(0,0,0,0.20);
}

body.dark-mode .card-search-fab,
body.night-mode .card-search-fab{
  border-color: rgba(255,255,255,0.14);
  background: rgba(17,25,40,0.92);
  color: #e5e7eb;
}

/* Search bar (modern expanding pill) */
.search-bar{
  display: flex;
  align-items: center;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-width 240ms ease, opacity 160ms ease;
}

.search-bar.active{
  max-width: 360px;
  opacity: 1;
}

.card-search-pill{
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 9999px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.10);
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.night-mode .card-search-pill,
body.dark-mode .card-search-pill{
  background: rgba(17,25,40,0.92);
  border-color: rgba(255,255,255,0.14);
}

#cardSearchInput{
  width: 280px;
  max-width: 100%;
  flex: 1;
  height: 42px;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Mobile: keep the floating search pill inside the viewport */
@media (max-width: 480px){
  .search-bar-container{
    left: 12px;
    bottom: 12px;
    gap: 8px;
  }

  /* 12px left + 12px right padding, plus the 56px FAB and 8px gap */
  .search-bar.active{
    max-width: calc(100vw - 24px - 56px - 8px);
  }

  .card-search-pill{
    width: 100%;
  }

  /* Let the input shrink properly on very small screens */
  #cardSearchInput{
    width: 100%;
    min-width: 0;
  }
}

body.night-mode #cardSearchInput,
body.dark-mode #cardSearchInput{
  color: #e5e7eb;
}

body.night-mode #cardSearchInput::placeholder,
body.dark-mode #cardSearchInput::placeholder{
  color: rgba(229,231,235,0.65);
}

.card-search-clear{
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  border: 1px solid rgba(0,0,0,0.10);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.night-mode .card-search-clear,
body.dark-mode .card-search-clear{
  border-color: rgba(255,255,255,0.14);
  color: #e5e7eb;
}

/* Info icon and tooltip */
.card {
  position: relative;
}

/* Style for the icon */
.card-info {
  position: absolute;
  top: 5px;
  right: 15px;
  color: #0070fa; /* Icon color */
  cursor: pointer;
}

/* Tooltip */
.card-tags-tooltip {
  display: none;
  position: absolute;
  top: 25px; 
  right: 0;
  background-color: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 10;
}

/* Show the tooltip */
.card-info:hover .card-tags-tooltip {
  display: block;
}

/* Favorite button styles */
.favorite-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #ccc;
  z-index: 5;
}

.favorite-btn.favorited {
  color: gold;
}

/* ---------------------------------------- */
/* NEW STYLE FOR CONTAINER TAGS  */
/* ---------------------------------------- */

/* Selected Container Tags */
.selected-tags-container {
  position: relative;
  /* Align with same cards margin */
  margin: 1rem 100px 0 100px;
  padding: 0; /* Remove padding */
  background-color: transparent; /* Remove grey bar */
  border-bottom: none; /* Remove border */
  display: flex;
  align-items: center;
  gap: 8px; /* spacement between chips */
  z-index: 10; 
}


body.landing-active .selected-tags-container {
  display: none !important;
}

/* Each chip style */
.tag-chip {
  display: inline-flex;
  align-items: center;
  background-color: #007bff;
  color: #fff;
  border-radius: 16px;
  padding: 4px 8px;
  font-size: 0.9rem;
  cursor: default;
}

/* Button “X” inside chip */
.tag-chip .remove-tag {
  margin-left: 8px;
  cursor: pointer;
  font-weight: bold;
}


@media only screen and (max-width: 1450px) {
  #cards-for-all{
    grid-template-columns: repeat(4,1fr) !important;
    gap: 20px;
  }
  [id^="cards-for-"]{
    grid-template-columns: repeat(4,1fr) !important;
    gap: 20px;
  }
}

@media only screen and (max-width: 1100px) {
  .header, .nav-tabs, .tab-content{
    margin-left: 100px;
    margin-right: 30px;
  }

  #cards-for-all{
    grid-template-columns: repeat(2,1fr) !important;
  }
  [id^="cards-for-"]{
    grid-template-columns: repeat(2,1fr) !important;
  }
}

@media only screen and (max-width: 600px) {
  .header, .nav-tabs, .tab-content{
    margin-left: 20px;
    margin-right: 30px;
  }

  #cards-for-all {
    display: flex !important;
    flex-direction: column;
    width: 95% !important; /* Increase width to occupy more screen space */
    max-width: 350px !important; /* Ensures a controlled size */
    margin-left: auto;
    margin-right: auto;
  }

  [id^="cards-for-"] {
    display: flex !important;
    flex-direction: column;
    margin-left: auto;
    margin-right: auto;
    width: 95% !important; /* Expands cards closer to the edges */
    max-width: 350px !important; /* Keeps a uniform width */
  }

  .cardscontent {
    margin: 1rem 20px 0 20px !important; 
  }

  /* Container Margin */
  .selected-tags-container {
    margin: 1rem 20px 0 20px !important;
  }
}

/* --- Ajustes mobile extra para não colidir com o drawer --- */
@media only screen and (max-width: 600px) {
  .header, .nav-tabs, .tab-content {
    margin-left: 20px !important;
    margin-right: 20px !important;
  }
  .selected-tags-container {
    margin: 1rem 20px 0 20px !important;
  }
}

.card-tags-label {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 0.25rem;
}

.tag-pill {
  max-width: 100%;
  font-size: 0.7rem;
}

.tag-more-pill {
  cursor: default;
  font-size: 0.7rem;
  background-color: #111827 !important; /* quase preto */
}