/* ==========================================================================
   Application layout (layouts/application.html.erb): base type, navbar,
   footer. Loaded after application.css (Materialize), so rules here win over
   Materialize rules of the same specificity.
   ========================================================================== */

/* ---------- Base ---------- */
html { overflow-y: scroll; }

span, p, a { font-family: "Source Sans Pro", sans-serif; }
h1, h2, h3, h4, h5, h6 { font-family: "Lato", sans-serif; }

input:hover { background: #f0f0f0 !important; }

/* Fixed-width icons so icon + label lists line up. */
i.fa,
i.fas,
i.far,
i.fab {
  display: inline-block;
  width: 32px;
  text-align: center;
}

.pagination .active {
  background-color: #c9c9c9 !important;
  border-radius: 50px;
}

.pagination .active a { font-weight: bold; }

.pagination .prev,
.pagination .next { color: #c9c9c9 !important; }

/* ---------- Navbar ----------
   40px high: dashboard.css sizes its sticky sidebar against that height. */
.navbar-main {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 40px;
  padding: 0 12px 0 8px;
  box-sizing: border-box;
  background: #fff;
  border-bottom: 1px solid #e2e5ea;
  color: #1f2530;
  font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  white-space: nowrap;
}

.navbar-main a,
.navbar-main button,
.navbar-main input { font-family: inherit; }

.navbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.navbar-logo {
  display: flex;
  align-items: center;
  padding: 0 4px;
}

.navbar-logo img {
  display: block;
  height: 30px;
  width: auto;
}

/* Selected repository; links to the dashboard to switch. */
.navbar-repo {
  display: inline-block;
  max-width: 220px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eaf2ff;
  color: #163f8a !important;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}

.navbar-repo:hover { background: #d9e7fd; }

.navbar-repo.is-empty {
  background: #fff0e0;
  color: #8a4b00 !important;
}

.navbar-repo.is-empty:hover { background: #ffe4c4; }

.navbar-links {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 100%;
}

.navbar-link {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 2px 10px 0;
  box-sizing: border-box;
  border-bottom: 2px solid transparent;
  color: #4b5563;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color 100ms ease, background 100ms ease;
}

.navbar-link:hover {
  background: #f6f7f9;
  color: #1f2530;
}

.navbar-link[aria-current="page"] {
  border-bottom-color: #1f6feb;
  color: #1f6feb;
}

.navbar-link-primary {
  height: 30px;
  margin-left: 4px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: #1f6feb;
  color: #fff;
  font-weight: 600;
}

.navbar-link-primary:hover {
  background: #1a5fcc;
  color: #fff;
}

/* Icon-only links (export, tags) */
.navbar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: #6a7280;
  font-size: 15px;
  text-decoration: none;
  transition: background 100ms ease, color 100ms ease;
}

.navbar-icon:hover {
  background: #f6f7f9;
  color: #1f2530;
}

.navbar-icon[aria-current="page"] {
  background: #eaf2ff;
  color: #1f6feb;
}

/* ---------- Search with suggestions ----------
   Selectors carry .navbar-main so they beat Materialize's input rules. */
.navbar-search {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 6px;
}

.navbar-main .navbar-search input[type="search"] {
  width: 200px;
  height: 30px;
  margin: 0;
  padding: 0 30px 0 10px;
  box-sizing: border-box;
  border: 1px solid #c8ccd3;
  border-radius: 6px;
  background: #fff;
  color: #1f2530;
  font-size: 13px;
  box-shadow: none;
  transition: border-color 100ms ease;
}

.navbar-main .navbar-search input[type="search"]:focus {
  border-color: #1f6feb;
  outline: none;
  box-shadow: none;
}

.navbar-search button {
  position: absolute;
  top: 50%;
  right: 4px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #6a7280;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.navbar-search button:hover {
  background: #eaf2ff;
  color: #1f6feb;
}

.navbar-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 500;
  width: 280px;
  max-height: 70vh;
  padding: 6px;
  box-sizing: border-box;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d5d8de;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 20, 30, 0.14);
  white-space: normal;
}

.navbar-suggestions[hidden] { display: none; }

.navbar-suggestion-group {
  display: block;
  padding: 6px 8px 2px;
  color: #6a7280;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.navbar-suggestion {
  display: block;
  padding: 6px 8px;
  border-radius: 6px;
  color: #1f2530;
  font-size: 13px;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navbar-suggestion:hover,
.navbar-suggestion:focus {
  background: #f6f7f9;
  color: #1f6feb;
  outline: none;
}

/* ---------- Account menu (opens on hover and on keyboard focus) ---------- */
.navbar-user {
  position: relative;
  display: flex;
  align-items: center;
  height: 40px;
  margin-left: 4px;
}

.navbar-user-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.navbar-user-toggle:hover,
.navbar-user-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.3);
}

.navbar-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  -o-object-fit: cover;
     object-fit: cover;
}

.navbar-avatar-initials {
  background: #b9bfc9;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.navbar-user-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 500;
  min-width: 250px;
  padding: 6px;
  background: #fff;
  border: 1px solid #d5d8de;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 20, 30, 0.14);
  white-space: normal;
}

.navbar-user:hover .navbar-user-menu,
.navbar-user:focus-within .navbar-user-menu { display: block; }

.navbar-user-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid #edeef1;
}

.navbar-user-head .navbar-avatar {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.navbar-user-who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.navbar-user-name,
.navbar-user-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navbar-user-name {
  color: #1f2530;
  font-size: 14px;
  font-weight: 700;
}

.navbar-user-email {
  color: #6a7280;
  font-size: 12px;
}

.navbar-user-menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: #1f2530;
  font-size: 13px;
  text-decoration: none;
}

.navbar-user-menu a:hover,
.navbar-user-menu a:focus {
  background: #f6f7f9;
  color: #1f6feb;
  outline: none;
}

.navbar-user-menu .navbar-user-logout {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid #edeef1;
  border-radius: 0 0 6px 6px;
}

@media (max-width: 760px) {
  .navbar-search { display: none; }
  .navbar-repo { max-width: 120px; }
}

/* ---------- Footer ---------- */
.app-footer {
  flex: 0 0 auto;
  background: #f6f7f9;
  border-top: 1px solid #e2e5ea;
  color: #4b5563;
  font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
}

.app-footer a,
.app-footer span,
.app-footer p,
.app-footer h2 { font-family: inherit; }

.app-footer-main {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px 14px;
  box-sizing: border-box;
}

.app-footer-brand {
  flex: 0 1 280px;
}

.app-footer-logo {
  display: inline-block;
}

.app-footer-logo img {
  display: block;
  height: 26px;
  width: auto;
}

.app-footer-brand p {
  margin: 6px 0 0;
  color: #6a7280;
  font-size: 13px;
  line-height: 1.4;
}

.app-footer-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, auto));
  gap: 12px 40px;
}

.app-footer-col h2 {
  margin: 0 0 6px;
  color: #1f2530;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app-footer-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-footer-col li {
  margin: 0 0 2px;
  line-height: 1.5;
}

.app-footer-col a {
  color: #4b5563;
  font-size: 13px;
  text-decoration: none;
  transition: color 100ms ease;
}

.app-footer-col a:hover,
.app-footer-col a:focus-visible {
  color: #1f6feb;
  text-decoration: underline;
}

.app-footer-col a i {
  margin-left: 2px;
  font-size: 11px;
}

.app-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 24px;
  box-sizing: border-box;
  border-top: 1px solid #e2e5ea;
  color: #6a7280;
  font-size: 12px;
}

.app-footer-bottom a {
  color: inherit;
  text-decoration: none;
}

.app-footer-bottom a:hover,
.app-footer-bottom a:focus-visible {
  color: #1f6feb;
  text-decoration: underline;
}

@media (max-width: 760px) {
  .app-footer-main { padding: 16px 16px 12px; }
  .app-footer-brand { flex-basis: 100%; }
  .app-footer-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .app-footer-bottom { padding: 8px 16px; }
}
