/* Saulaigh VR App - Luxury Architectural Aesthetic */

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

html, body {
  width: 100%;
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: #faf9f7;
  overflow: hidden;
  color: #2c2c2c;
}

/* A-Frame Canvas */
canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ===== LOGIN PAGE STYLES ===== */

.login-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #faf9f7 0%, #f5f2f0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.login-page.hidden {
  opacity: 0;
  pointer-events: none;
}

.login-container {
  width: 100%;
  max-width: 450px;
  padding: 60px 40px;
  background: white;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(30, 110, 58, 0.08);
}

.login-content {
  text-align: center;
}

.login-title {
  font-family: 'Playfair Display', serif;
  font-size: 52px;
  font-weight: 700;
  color: #1e6e3a;
  letter-spacing: 3px;
  margin-bottom: 12px;
}

.login-subtitle {
  font-size: 13px;
  color: #999;
  letter-spacing: 2px;
  margin-bottom: 50px;
  text-transform: uppercase;
  font-weight: 500;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-input {
  padding: 16px 18px;
  border: 1px solid #e6e1db;
  border-radius: 3px;
  background: #fefdfb;
  color: #2c2c2c;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
  letter-spacing: 0.3px;
}

.login-input::placeholder {
  color: #aaa;
}

.login-input:focus {
  outline: none;
  border-color: #a8860f;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(168, 134, 15, 0.1);
}

.login-btn {
  padding: 16px 28px;
  background: linear-gradient(135deg, #1e6e3a 0%, #186d32 100%);
  color: #ffffff;
  border: none;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
  margin-top: 8px;
  text-transform: uppercase;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(30, 110, 58, 0.25);
}

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

.login-error {
  color: #c1534f;
  font-size: 13px;
  margin-top: 12px;
  min-height: 20px;
  display: none;
}

.login-error:not(:empty) {
  display: block;
}

/* ===== PORTAL PAGE STYLES ===== */

.portal-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #faf9f7;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* Header */
.portal-header {
  background: linear-gradient(180deg, #ffffff 0%, #fefdfb 100%);
  border-bottom: 1px solid #e0d9d0;
  padding: 32px 40px;
  box-shadow: 0 4px 16px rgba(30, 110, 58, 0.06), 0 1px 3px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
  backdrop-filter: blur(8px);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1600px;
  margin: 0 auto;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.portal-title {
  font-family: 'Playfair Display', serif;
  font-size: 38px;
  font-weight: 700;
  color: #1e6e3a;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.portal-subtitle {
  font-size: 13px;
  color: #a89074;
  letter-spacing: 0.5px;
  font-weight: 500;
  font-style: italic;
}

.logout-btn {
  padding: 12px 28px;
  background: linear-gradient(135deg, #1e6e3a 0%, #186d32 100%);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
}

.logout-icon {
  font-size: 14px;
  transition: transform 0.3s ease;
}

.logout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(30, 110, 58, 0.25);
}

.logout-btn:hover .logout-icon {
  transform: translate(2px, -2px);
}

/* Main Content */
.portal-main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Gallery Section */
.gallery-section {
  flex: 1;
  padding: 60px 40px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.portal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  width: 100%;
}

/* Card Design - Gallery/Exhibition Style */
.map-card {
  background: white;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  border: 1px solid #f0ebe5;
  position: relative;
  height: 100%;
}

.map-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(168, 134, 15, 0) 0%, rgba(168, 134, 15, 0.03) 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  border-radius: 4px;
  z-index: 1;
}

.map-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 24px 48px rgba(30, 110, 58, 0.12);
  border-color: #a8860f;
}

.map-card:hover::before {
  opacity: 1;
}

.map-card-image {
  width: 100%;
  height: 220px;
  background: linear-gradient(135deg, #e8f5f0 0%, #d0e8df 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: #1e6e3a;
  object-fit: cover;
  border: none;
  position: relative;
}

.map-card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
  background: white;
  position: relative;
  z-index: 2;
}

.map-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: #1e6e3a;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.map-card-description {
  font-size: 14px;
  color: #888;
  line-height: 1.7;
  margin-bottom: 24px;
  flex: 1;
  font-weight: 400;
}

.map-card-button {
  padding: 14px 24px;
  background: linear-gradient(135deg, #1e6e3a 0%, #186d32 100%);
  color: #ffffff;
  border: none;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-family: 'Inter', sans-serif;
  align-self: flex-start;
  position: relative;
  overflow: hidden;
}

.map-card-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: #a8860f;
  transition: left 0.3s ease;
  z-index: -1;
}

.map-card-button:hover::before {
  left: 0;
}

.map-card-button:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(30, 110, 58, 0.25);
}

.map-card-button:active {
  transform: translateX(2px);
}

/* Footer */
.portal-footer {
  background: white;
  border-top: 1px solid #ede8e2;
  flex-shrink: 0;
  margin-top: auto;
}

.footer-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #1e6e3a, transparent);
  opacity: 0.2;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 48px;
  padding: 48px 40px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.footer-section {
  display: flex;
  flex-direction: column;
}

.footer-title {
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  font-weight: 700;
  color: #1e6e3a;
  letter-spacing: 1px;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-links a {
  font-size: 13px;
  color: #888;
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: all 0.3s ease;
  position: relative;
  display: inline-block;
  width: fit-content;
}

.footer-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1px;
  background: #a8860f;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.footer-links a:hover {
  color: #1e6e3a;
}

.footer-links a:hover::after {
  transform: scaleX(1);
}

.footer-bottom {
  background: #faf9f7;
  padding: 24px 40px;
  text-align: center;
  border-top: 1px solid #ede8e2;
}

.footer-copyright {
  font-size: 12px;
  color: #999;
  letter-spacing: 0.5px;
}

/* ===== LOADING SCREEN ===== */

.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #faf9f7 0%, #f5f2f0 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-content {
  text-align: center;
  max-width: 400px;
  padding: 40px;
}

.loading-title {
  font-family: 'Playfair Display', serif;
  color: #1e6e3a;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 1.5px;
  margin-bottom: 48px;
  text-transform: uppercase;
}

.progress-bar-container {
  width: 100%;
  height: 3px;
  background: rgba(30, 110, 58, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 28px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #1e6e3a 0%, #2d9c52 100%);
  width: 0%;
  border-radius: 2px;
  transition: width 0.3s ease;
  box-shadow: 0 0 12px rgba(30, 110, 58, 0.4);
}

.loading-subtitle {
  color: #999;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ===== VR SCENE STYLES ===== */

.a-enter-vr {
  bottom: 20px;
  right: 20px;
  background: #1e6e3a;
  border: none;
  border-radius: 4px;
  color: white;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(30, 110, 58, 0.25);
  z-index: 999;
  letter-spacing: 0.5px;
}

.a-enter-vr:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30, 110, 58, 0.35);
  background: #185235;
}

.a-enter-vr:active {
  transform: translateY(0);
}

.a-enter-vr.hidden {
  display: none;
}

#vr-instructions {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.98);
  color: #333333;
  padding: 16px 24px;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  border-left: 4px solid #1e6e3a;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  max-width: 200px;
  line-height: 1.6;
  box-shadow: 0 4px 16px rgba(30, 110, 58, 0.15);
  z-index: 998;
}

#vr-instructions p {
  margin: 4px 0;
}

#vr-instructions p:first-child {
  font-weight: 600;
  color: #1e6e3a;
  margin-bottom: 8px;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 4px;
}

.debug-info {
  position: fixed;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: #1e6e3a;
  padding: 10px 15px;
  border-radius: 4px;
  border-left: 3px solid #1e6e3a;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  max-width: 300px;
  line-height: 1.4;
  z-index: 997;
  display: none;
}

.debug-info.visible {
  display: block;
}

/* ===== GET SET UP SECTION ===== */

.setup-section {
  padding: 80px 40px;
  background: linear-gradient(180deg, #fafaf9 0%, #f5f2f0 100%);
  border-top: 1px solid #ede8e2;
  width: 100%;
}

.setup-container {
  max-width: 1000px;
  margin: 0 auto;
}

.setup-header {
  text-align: center;
  margin-bottom: 60px;
}

.setup-title {
  font-family: 'Playfair Display', serif;
  font-size: 42px;
  font-weight: 700;
  color: #1e6e3a;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.setup-subtitle {
  font-size: 13px;
  color: #999;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 500;
}

.setup-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 48px;
  margin-bottom: 48px;
}

.setup-step {
  display: flex;
  gap: 20px;
}

.setup-step-number {
  width: 60px;
  height: 60px;
  min-width: 60px;
  background: linear-gradient(135deg, #1e6e3a 0%, #186d32 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  font-family: 'Playfair Display', serif;
  box-shadow: 0 8px 24px rgba(30, 110, 58, 0.15);
}

.setup-step-content h3 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: #1e6e3a;
  margin-bottom: 8px;
  font-weight: 700;
}

.setup-step-content p {
  font-size: 14px;
  color: #888;
  line-height: 1.6;
  font-weight: 400;
}

.setup-note {
  background: white;
  padding: 24px;
  border-radius: 4px;
  border-left: 4px solid #a8860f;
  font-size: 14px;
  color: #2c2c2c;
  line-height: 1.7;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.setup-note strong {
  color: #a8860f;
  font-weight: 600;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 1024px) {
  .portal-gallery {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
  }

  .footer-content {
    gap: 32px;
    padding: 40px 32px;
  }
}

@media (max-width: 768px) {
  .portal-header {
    padding: 20px 20px;
  }

  .header-content {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .portal-title {
    font-size: 28px;
  }

  .logout-btn {
    align-self: flex-start;
  }

  .gallery-section {
    padding: 40px 20px;
  }

  .portal-gallery {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .map-card-content {
    padding: 24px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 32px 20px;
  }

  .footer-bottom {
    padding: 20px;
  }

  .loading-title {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .portal-title {
    font-size: 24px;
  }

  .map-card-title {
    font-size: 20px;
  }

  .logout-btn {
    padding: 10px 20px;
    font-size: 11px;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .a-enter-vr {
    bottom: 15px;
    right: 15px;
    padding: 10px 20px;
    font-size: 12px;
  }


  #vr-instructions {
    bottom: 15px;
    left: 15px;
    padding: 12px 16px;
    font-size: 11px;
  }
}

/* ===== IMMERSIVE EXPERIENCE STYLES ===== */

#experience-overlay {
  /* Covered by inline styles in portal-scene.js */
}

#experience-iframe {
  /* Covered by inline styles in portal-scene.js */
}

#experience-back-btn {
  /* Covered by inline styles in portal-scene.js */
}

#experience-back-btn:active {
  transform: translateY(0) !important;
}

/* Prevent scrolling when experience is open */
.experience-open {
  overflow: hidden !important;
  height: 100vh;
  height: 100dvh; /* Support dynamic viewport on mobile */
}
