/* ===============================
   RESET & BASE
================================ */

* {
  box-sizing: border-box;
}



/* ===============================
   SPINNER
================================ */

.spinner {
  border: 4px solid #ccc;
  border-top: 4px solid #004080;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
  display: inline-block;
  margin-right: 10px;
  vertical-align: middle;
}

@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===============================
   CONTAINER
================================ */

#container {
  max-width: 1300px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.9);
  padding: 30px 40px;
  box-shadow: 0 0 25px rgba(0, 70, 140, 0.2);
  border-radius: 8px;
}

/* ===============================
   HEADER
================================ */

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  position: relative;
  background: transparent;
}

.title-left {
  flex-shrink: 0;
}

.main-title {
  font-family: "Arial Narrow", Arial, sans-serif;
  font-weight: bold;
  color: #003366;
  font-size: 6rem;
  margin: 0;
  filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.3));
}

.branding-right {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo {
  width: 200px;
  height: 132px;
  filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.3));
}

.tagline {
  font-size: 1rem;
  color: #333;
  margin-top: 4px;
  filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.3));
}

/* ===============================
   MAIN LAYOUT
================================ */

main {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  justify-content: space-between;
}

.info {
  flex: 1 1 50%;
}

.spec-title {
  font-weight: bold;
  font-size: 2.5rem;
  color: gray;
}

.description {
  font-size: 1.5rem;
  text-align: justify;
}

/* ===============================
   FOOTER
================================ */

footer.footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 30px 40px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.footer-left {
  display: flex;
}

.cert-footer {
  width: 150px;
  filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.2));
}

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-width: 60%;
  text-align: right;
}

.address-block {
  font-size: 0.9rem;
  line-height: 1.6;
}

.address-block a {
  color: #004080;
  text-decoration: none;
}

.address-block a:hover {
  text-decoration: underline;
}

/* ===============================
   MODEL PLACEHOLDER (INDEX)
================================ */

#model-section {
  flex: 1 1 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.model-placeholder {
  width: 100%;
  height: 400px;
  display: flex;
  justify-content: center;
}

.placeholder-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.view-3d-button {
  margin-top: 15px;
  padding: 10px 20px;
  background: #007bff;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
}

.view-3d-button:hover {
  background: #0056b3;
}

.view-modes button.active,
.view-tools button.active {
    background-color: #004080;  /* Blue when selected */
    color: white;
    transition: background-color 0.2s;
}

/* ===============================
   VIEWER PAGE
================================ */

.viewer-page {
  margin: 0;
  overflow: hidden;
  background-color: #FFF;
}

/* Viewer canvas container */
.viewer-page #model-viewer {
  width: 100vw;
  height: 100vh;
}

/* ===============================
   LOADING OVERLAY
================================ */

.viewer-page #loading {
  position: fixed;
  inset: 0;
  color: black;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.loading-bar-container {
  width: 300px;
  height: 20px;
  background: #555;
  border-radius: 10px;
  margin-bottom: 15px;
  overflow: hidden;
}

.loading-bar-progress {
  height: 100%;
  width: 0%;
  background: #007bff;
  transition: width 0.1s ease-out;
}

#loading-text {
  font-size: 1.2rem;
  font-weight: bold;
}

/* ===============================
   VIEWER CONTROLS
================================ */

#model-controls {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 10;
}

/* -------- Row 1: View Modes -------- */

.viewer-page .view-modes {
  display: flex;
  gap: 10px;
}

.viewer-page .view-modes button {
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: bold;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  background: rgba(255,55,55,0.9);
}

.viewer-page .view-modes button.active {
  background: #004080;
  color: white;
}

/* -------- Row 2: Tools -------- */

.viewer-page .view-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.viewer-page .view-tools button {
  width: 37px;
  height: 37px;
  border: none;
  border-radius: 5px;
  background: rgba(255,55,55,0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.viewer-page .view-tools button:hover {
  background: #f6f;
}

/* ===============================
   RESPONSIVE
================================ */

@media (max-width: 768px) {

  main {
    flex-direction: column;
  }

  .main-title {
    font-size: 3rem;
  }

  footer.footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-right {
    align-items: center;
    max-width: 100%;
  }

  #model-controls {
    max-width: 95%;
  }
}
