:root {
  --bg-color: #ffffff;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --accent-color: #2563eb;
  --border-color: #e5e7eb;
  --hover-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Login page background */
body.login-page {
  background-image: url('images/login-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body.login-page::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  z-index: -1;
}

body.login-page h1,
body.login-page p {
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Typography */
h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

p {
  color: var(--text-secondary);
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.center-layout {
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* Login Form */
.login-box {
  width: 100%;
  max-width: 400px;
  padding: 3rem;
  background: rgba(255, 255, 255, 0.33);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  margin-top: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn {
  width: 100%;
  padding: 0.875rem 1.5rem;
  background-color: var(--text-primary);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, background-color 0.2s;
}

.btn:hover {
  background-color: #000000;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.error-message {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 1rem;
  min-height: 1.25rem;
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

.logout-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s;
}

.logout-btn:hover {
  color: var(--text-primary);
}

/* Grid Layout */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2.5rem;
  padding-bottom: 4rem;
}

@media (max-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

.project-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  group;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--hover-shadow);
  border-color: var(--border-color);
}

.image-container {
  width: 100%;
  aspect-ratio: 16 / 10;
  background-color: #f3f4f6;
  overflow: hidden;
  position: relative;
  border-radius: 12px;
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover .image-container img {
  transform: scale(1.05);
}

.project-info {
  padding: 1.25rem 0.5rem;
}

.project-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-title svg {
  width: 20px;
  height: 20px;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
  color: var(--text-secondary);
}

.project-card:hover .project-title svg {
  opacity: 1;
  transform: translateX(0);
}

/* Section headings on projects page */
/* Facility tree */
.facility-tree {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 0.75rem 0 1.25rem;
  color: var(--text-primary);
  white-space: pre;
  overflow-x: auto;
}

/* Platform summary table */
.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

.summary-table th,
.summary-table td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.summary-table th {
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-table td {
  color: var(--text-secondary);
}

.summary-table td:first-child {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  width: 35%;
}

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

.project-card--inactive {
  cursor: default;
  opacity: 0.6;
}

.project-card--inactive:hover {
  transform: none;
  box-shadow: none;
}

.coming-soon-label {
  color: var(--accent-color);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0;
}

.section-heading {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-color);
  margin-bottom: 1.25rem;
  margin-top: 0;
}

.section-subheading {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
  max-width: 600px;
}

.projects-section + .projects-section {
  margin-top: 3rem;
}

/* Project Detail Pages */
.back-link {
  margin-bottom: 1.5rem;
}

.back-link a {
  color: var(--accent-color);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.back-link a:hover {
  color: var(--text-primary);
}

.project-detail {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 4rem;
  margin-top: 2rem;
  align-items: start;
}

.project-overview h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  margin-top: 0;
}

.project-overview ul {
  padding-left: 1.25rem;
  margin-top: 0.5rem;
}

.project-overview ul li {
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 1rem;
  padding-left: 0.25rem;
}

.project-overview h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
}

.project-overview p {
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 1rem;
  margin-top: 0;
}

.project-showcase img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  display: block;
}

.visit-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  color: var(--accent-color);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
  transition: gap 0.2s;
}

.visit-link:hover {
  gap: 0.75rem;
}

@media (max-width: 768px) {
  .project-detail {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: auto;
}
