/* ==========================================================================
   DevPi Theme — hochguertel.work
   Bulma-based professional theme with SSO integration
   ========================================================================== */

/* --- Layout: fixed navbar offset --- */
body {
  padding-top: 3.25rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* --- Navbar --- */
.navbar.is-primary {
  background-color: #2c3e50;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.navbar.is-primary .navbar-item,
.navbar.is-primary .navbar-link {
  color: #ecf0f1;
}

.navbar.is-primary .navbar-item:hover,
.navbar.is-primary .navbar-link:hover,
.navbar.is-primary .navbar-item.is-active {
  background-color: #34495e;
  color: #fff;
}

.navbar.is-primary .navbar-burger span {
  background-color: #ecf0f1;
}

.navbar-brand strong {
  font-size: 1.15rem;
  letter-spacing: 0.5px;
}

.navbar-dropdown {
  border-top: 2px solid #3498db;
  min-width: 220px;
}

.navbar-dropdown .navbar-item {
  color: #363636;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
}

.navbar-dropdown .navbar-item:hover {
  background-color: #f5f5f5;
  color: #3498db;
}

.navbar-dropdown .navbar-item.is-active {
  background-color: #ebf5fb;
  color: #2980b9;
}

.navbar-dropdown .navbar-item .icon {
  margin-right: 0.4rem;
}

.navbar-divider {
  margin: 0.25rem 0;
}

/* Ensure dropdown items have dark text on white background */
.navbar.is-primary .navbar-dropdown .navbar-item,
.navbar.is-primary .navbar-dropdown .navbar-link {
  color: #363636 !important;
  background-color: #fff;
}

.navbar.is-primary .navbar-dropdown .navbar-item:hover,
.navbar.is-primary .navbar-dropdown .navbar-link:hover {
  background-color: #f5f5f5 !important;
  color: #3498db !important;
}

/* Dropdown container */
.navbar.is-primary .navbar-dropdown {
  background-color: #fff;
  border-top: 2px solid #3498db;
}

/* --- Search form in navbar --- */
.devpi-search-form {
  flex: 1;
  max-width: 500px;
}

.devpi-search-form .input {
  min-width: 0;
  width: 100%;
  border-radius: 4px 0 0 4px;
}

.devpi-search-form .field.has-addons {
  width: 100%;
}

.devpi-search-form .button {
  border-radius: 0 4px 4px 0;
}

/* --- SSO User Info --- */
.sso-user-info {
  line-height: 1.4;
}

.sso-user-info .icon.is-small {
  vertical-align: middle;
  margin-right: 0.15rem;
}

/* --- Sub-header (breadcrumbs + status) --- */
.devpi-subheader {
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  padding: 0.4rem 1.5rem;
}

/* --- Breadcrumb styling --- */
#navigation {
  font-size: 0.9rem;
}

#navigation a {
  color: #3498db;
  text-decoration: none;
}

#navigation a:hover {
  color: #2980b9;
  text-decoration: underline;
}

/* --- Content area --- */
#content {
  max-width: 1140px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* --- DevPi default search form override --- */
#search {
  margin: 0;
  padding: 0;
}

#search h1 {
  display: none; /* Logo is in the navbar now */
}

#search input[type="text"] {
  display: none; /* Search is in the navbar now */
}

#search input[type="submit"] {
  display: none; /* Search is in the navbar now */
}

#search .help {
  display: none; /* Search help is in the navbar now */
}

/* --- Tables (package listings) --- */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;
}

table thead th {
  background: #f8f9fa;
  color: #2c3e50;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid #dee2e6;
  text-align: left;
}

table tbody td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

table tbody tr:hover {
  background-color: #f8f9fa;
}

table tbody tr:last-child td {
  border-bottom: none;
}

table a {
  color: #3498db;
  text-decoration: none;
  font-weight: 500;
}

table a:hover {
  color: #2980b9;
  text-decoration: underline;
}

/* --- User/Index Listings (directory tree) --- */
.user_index_list {
  padding: 1rem 0;
}

.user_index_list dl {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 0;
  margin-bottom: 1rem;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.user_index_list dt {
  background: #f8f9fa;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #e9ecef;
  font-weight: 600;
  font-size: 1.1rem;
}

.user_index_list dt a {
  color: #2c3e50;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.user_index_list dt a::before {
  content: '👤';
  margin-right: 0.5rem;
}

.user_index_list dt a:hover {
  color: #3498db;
}

.user_index_list dd {
  margin: 0;
  padding: 0;
}

.user_index_list dd ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.user_index_list dd ul li {
  border-bottom: 1px solid #f0f0f0;
}

.user_index_list dd ul li:last-child {
  border-bottom: none;
}

.user_index_list dd ul li a {
  display: flex;
  align-items: center;
  padding: 0.6rem 1.25rem 0.6rem 2.5rem;
  color: #4a4a4a;
  text-decoration: none;
  transition: background-color 0.15s;
}

.user_index_list dd ul li a::before {
  content: '📁';
  margin-right: 0.5rem;
}

.user_index_list dd ul li a:hover {
  background-color: #f5f8ff;
  color: #3498db;
}

.user_index_list dd ul li a span {
  display: inline-block;
  background: #e8f4f8;
  color: #2980b9;
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  margin-left: 0.5rem;
  font-weight: 500;
}

.user_description {
  color: #6c757d;
  font-size: 0.9rem;
}

/* --- Package info sections --- */
.projectinfo {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

/* --- Status badges --- */
.statusbadge a {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.statusbadge .ok {
  background: #d4edda;
  color: #155724;
}

.statusbadge .warn {
  background: #fff3cd;
  color: #856404;
}

.statusbadge .fatal {
  background: #f8d7da;
  color: #721c24;
}

/* --- Links --- */
a {
  color: #3498db;
  transition: color 0.15s ease;
}

a:hover {
  color: #2980b9;
}

/* --- Footer --- */
.devpi-footer {
  background-color: #2c3e50;
  padding: 3rem 1.5rem 2rem;
  margin-top: 2rem;
}

.devpi-footer .title {
  margin-bottom: 0.75rem;
}

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

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

.footer-links a {
  color: #95a5a6;
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: #3498db;
}

.footer-divider {
  background-color: #34495e;
  margin: 1.5rem 0;
}

.footer-versions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-versions li {
  color: #7f8c8d;
  font-size: 0.75rem;
  background: #34495e;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}

/* --- Package Detail Page (PyPI.org inspired) --- */
.projectpage {
  max-width: 100%;
}

.projectpage h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 0.5rem;
  border-bottom: 3px solid #3498db;
  padding-bottom: 0.5rem;
}

.projectpage .description {
  font-size: 1rem;
  color: #555;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* Install command box */
.projectpage pre {
  background: #2c3e50;
  color: #ecf0f1;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  font-size: 0.95rem;
  position: relative;
  margin: 1rem 0;
}

/* Navigation tabs */
.projectpage .nav ul {
  display: flex;
  list-style: none;
  padding: 0;
  border-bottom: 2px solid #e9ecef;
  margin-bottom: 1.5rem;
}

.projectpage .nav li {
  margin-right: 0;
}

.projectpage .nav li a {
  display: block;
  padding: 0.75rem 1.25rem;
  color: #6c757d;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-weight: 500;
}

.projectpage .nav li a:hover,
.projectpage .nav li a.active {
  color: #3498db;
  border-bottom-color: #3498db;
}

/* Metadata sidebar styling */
.sidebar_column {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.25rem;
}

.sidebar_column h3,
.sidebar_column h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6c757d;
  margin-bottom: 0.5rem;
}

/* Release files table */
table.files {
  width: 100%;
}

table.files td {
  vertical-align: middle;
}

/* --- Accessibility --- */
a:focus,
button:focus,
input:focus,
.navbar-item:focus,
.navbar-link:focus {
  outline: 2px solid #3498db;
  outline-offset: 2px;
}

/* --- Tox results --- */
.toxresult-header {
  cursor: pointer;
  padding: 0.5rem;
  background: #f5f5f5;
  border-radius: 4px;
  margin-bottom: 0.25rem;
}

.toxresult-header:hover {
  background: #eee;
}

/* --- Permissions --- */
.permissions dt {
  font-weight: 600;
  margin-top: 0.5rem;
}

.permissions dd {
  margin-left: 1rem;
  color: #6c757d;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Mobile: up to 768px (iPhone 11 = 375px) */
@media screen and (max-width: 768px) {
  body {
    font-size: 14px;
  }

  .navbar-menu {
    background-color: #2c3e50;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    padding-bottom: 0.5rem;
  }

  .navbar-menu .navbar-item,
  .navbar-menu .navbar-link {
    color: #ecf0f1;
    padding: 0.5rem 1rem;
  }

  .navbar-menu .navbar-dropdown {
    background-color: #34495e;
    border-top: none;
    padding: 0;
  }

  .navbar-menu .navbar-dropdown .navbar-item {
    color: #bdc3c7;
    padding-left: 2rem;
    font-size: 0.85rem;
  }

  .navbar-menu .navbar-dropdown .navbar-item:hover {
    background-color: #3d566e;
    color: #fff;
  }

  .navbar-menu .navbar-dropdown .navbar-item.is-active {
    background-color: #3d566e;
    color: #3498db;
  }

  .navbar-menu .navbar-divider {
    background-color: #4a6785;
  }

  .devpi-search-form {
    width: 100%;
  }

  .devpi-search-form .input {
    min-width: 0;
    width: 100%;
  }

  .devpi-search-form .field.has-addons {
    width: 100%;
  }

  .devpi-search-form .field.has-addons .control:first-child {
    flex: 1;
  }

  .devpi-subheader {
    padding: 0.3rem 0.75rem;
    font-size: 0.85rem;
  }

  #content {
    padding: 0.75rem;
  }

  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table thead th,
  table tbody td {
    padding: 0.5rem;
    font-size: 0.85rem;
  }

  .user_index_list dl {
    padding: 0.75rem;
  }

  pre {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    font-size: 0.8rem;
  }
}

/* Small phones (iPhone SE: 320px) */
@media screen and (max-width: 375px) {
  body {
    font-size: 13px;
  }

  .navbar-brand strong {
    font-size: 1rem;
  }

  #content {
    padding: 0.5rem;
  }

  table thead th,
  table tbody td {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
  }
}

/* Tablet: 769px - 1023px */
@media screen and (min-width: 769px) and (max-width: 1023px) {
  #content {
    max-width: 720px;
    padding: 1.25rem;
  }

  .devpi-search-form .input {
    min-width: 180px;
  }
}

/* Desktop: 1024px+ */
@media screen and (min-width: 1024px) {
  #content {
    max-width: 960px;
  }

  .devpi-search-form .input {
    min-width: 250px;
  }
}

/* Wide desktop: 1200px+ */
@media screen and (min-width: 1200px) {
  #content {
    max-width: 1140px;
  }

  .devpi-search-form .input {
    min-width: 300px;
  }
}

/* Landscape orientation adjustments */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .navbar {
    min-height: 2.5rem;
  }

  body {
    padding-top: 2.5rem;
  }

  .devpi-subheader {
    padding: 0.2rem 0.75rem;
  }
}
