/* PubHub Base Styles */

/* Login Container */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-card {
  background: var(--pico-card-background-color);
  border-radius: 1rem;
  padding: 3rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header .logo {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  color: var(--pico-primary);
}

.login-header h1 {
  margin: 0;
  font-size: 2rem;
}

.login-header .tagline {
  color: var(--pico-muted-color);
  margin: 0.5rem 0 0;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-card input {
  text-align: center;
  font-size: 1rem;
  padding: 0.875rem;
}

.login-card button {
  width: 100%;
}

.error-msg {
  color: var(--pico-del-color);
  text-align: center;
  margin-top: 1rem;
  font-size: 0.875rem;
}

/* Portal Header */
.portal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-left h1 {
  margin: 0;
  font-size: 1.5rem;
}

.logo-small {
  width: 32px;
  height: 32px;
  color: var(--pico-primary);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  color: var(--pico-muted-color);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--pico-primary);
}

.nav-link.logout {
  color: var(--pico-del-color);
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--pico-muted-color);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem;
}

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.service-card {
  background: var(--pico-card-background-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--pico-muted-border-color);
}

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

.service-card.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.service-card .service-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  color: var(--pico-primary);
}

.service-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.service-card p {
  color: var(--pico-muted-color);
  margin: 0;
  font-size: 0.875rem;
  flex: 1;
}

.service-card .service-access {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--pico-muted-border-color);
  font-size: 0.8rem;
  color: var(--pico-muted-color);
}

.service-card .access-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  font-weight: 500;
  font-size: 0.75rem;
}

.access-badge.admin { background: var(--pico-primary-background); color: var(--pico-primary-inverse); }
.access-badge.write { background: var(--pico-ins-color); color: #fff; }
.access-badge.read { background: var(--pico-secondary); color: #fff; }
.access-badge.none { background: var(--pico-muted-color); color: #fff; }

/* Team Grid */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.team-card {
  background: var(--pico-card-background-color);
  border-radius: 0.75rem;
  padding: 1.25rem;
  text-align: center;
  border: 1px solid var(--pico-muted-border-color);
}

.team-card .avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--pico-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 auto 1rem;
}

.team-card h4 {
  margin: 0 0 0.25rem;
}

.team-card p {
  color: var(--pico-muted-color);
  margin: 0;
  font-size: 0.875rem;
}

.team-card .badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  background: var(--pico-primary-background);
  color: var(--pico-primary-inverse);
  margin-top: 0.5rem;
}

/* Profile */
.profile-card {
  background: var(--pico-card-background-color);
  border-radius: 0.75rem;
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--pico-muted-border-color);
}

.profile-card .profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.profile-card .avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--pico-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 600;
}

.profile-info h3 {
  margin: 0 0 0.25rem;
}

.profile-info p {
  color: var(--pico-muted-color);
  margin: 0;
  font-size: 0.875rem;
}

.profile-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.profile-detail {
  padding: 1rem;
  background: var(--pico-background-color);
  border-radius: 0.5rem;
}

.profile-detail label {
  font-size: 0.75rem;
  color: var(--pico-muted-color);
  display: block;
  margin-bottom: 0.25rem;
}

.profile-detail span {
  font-weight: 500;
}

/* Machines List */
.machines-list {
  display: grid;
  gap: 1rem;
}

.machine-card {
  background: var(--pico-card-background-color);
  border-radius: 0.5rem;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--pico-muted-border-color);
}

.machine-card h4 {
  margin: 0 0 0.25rem;
}

.machine-card .machine-id {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--pico-muted-color);
}

.machine-card .last-seen {
  text-align: right;
  font-size: 0.8rem;
  color: var(--pico-muted-color);
}

/* Pages */
.page {
  animation: fadeIn 0.2s ease;
}

.page h2 {
  margin-bottom: 1.5rem;
}

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

/* Responsive */
@media (max-width: 768px) {
  .portal-header {
    flex-direction: column;
    gap: 1rem;
  }

  .header-nav {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
}
