/* PhillyXR - Dark Theme */
:root {
  /* Dark backgrounds - various shades of black */
  --bg-primary: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #2a2a2a;
  --bg-card: #1f1f1f;
  --bg-hover: #2f2f2f;
  
  /* Accent - Red */
  --accent: #ff3333;
  --accent-dark: #cc0000;
  --accent-light: #ff6666;
  --accent-hover: #ff5555;
  
  /* Text colors - light */
  --text-primary: #ffffff;
  --text-secondary: #e0e0e0;
  --text-muted: #b0b0b0;
  
  /* Borders and dividers */
  --border-color: #333333;
  --border-light: #444444;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background: var(--bg-primary);
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--text-primary);
  background: var(--bg-primary);
  background-attachment: fixed;
  line-height: 1.6;
  min-height: 100vh;
}

/* Header - Dark with red accent */
header {
  background: #010101;
  color: var(--text-primary);
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  border-bottom: 2px solid var(--accent);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  min-height: 80px;
  padding: 0 1rem;
  display: flex;
  align-items: center;
}

.menu-toggle {
  position: absolute;
  right: 1rem;
  z-index: 12;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.2rem;
}

.menu-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.public-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 1rem;
  z-index: 20;
  min-width: 180px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  padding: 0.5rem;
}

.public-menu.hidden {
  display: none;
}

.public-menu a {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  color: var(--text-primary);
  text-decoration: none;
}

.public-menu a:hover {
  background: var(--bg-hover);
  color: var(--accent-light);
}

/* Logo is ALWAYS absolutely centered, regardless of other elements */
.header-logo-link {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  height: 100%;
  display: block;
}

.header-logo {
  height: 100%;
  width: auto;
  object-fit: contain;
  display: block;
}

/* Back button positioned separately, doesn't affect logo centering */
.header-content .btn-back-header {
  position: relative;
  z-index: 10;
}

/* Back button in header */
.btn-back-header {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-radius: 50%;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: bold;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.btn-back-header:hover {
  background: var(--accent);
  color: var(--text-primary);
  transform: scale(1.1) rotate(-5deg);
  box-shadow: 0 4px 12px rgba(255, 51, 51, 0.4);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  background: var(--bg-primary);
  min-height: calc(100vh - 200px);
}

/* Hero Section - Dark background */
.hero {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-secondary);
  border-radius: 16px;
  margin-bottom: 3rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 50%, rgba(255, 51, 51, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero h2 {
  color: var(--text-primary);
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.hero h2::after {
  content: '';
  display: block;
  width: 100px;
  height: 3px;
  background: var(--accent);
  margin: 1rem auto 0;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.8;
  position: relative;
  z-index: 1;
}

/* About Section */
.about {
  background: var(--bg-secondary);
  padding: 3rem 2rem;
  border-radius: 12px;
  margin-bottom: 3rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
}

.about h2 {
  color: var(--text-primary);
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.5rem;
  display: inline-block;
}

.about p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.about p:last-child {
  margin-bottom: 0;
}

/* Models Section */
.models-section {
  margin-top: 2rem;
  padding: 2rem;
  background: var(--bg-primary);
  border-radius: 16px;
}

.models-section h2 {
  color: var(--text-primary);
  font-size: 2rem;
  margin-bottom: 2rem;
  font-weight: 700;
  text-align: center;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 1rem;
  display: inline-block;
  width: 100%;
}

/* Model Grid */
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.model-card {
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  border: 1px solid var(--border-color);
  position: relative;
}

.model-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.model-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgba(255, 51, 51, 0.3);
  border-color: var(--accent);
  background: var(--bg-hover);
}

.model-card:hover::before {
  opacity: 1;
}

.model-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--bg-tertiary);
  transition: transform 0.3s ease;
  filter: brightness(0.9);
}

.model-card:hover .model-card-image {
  transform: scale(1.05);
  filter: brightness(1);
}

.model-card-content {
  padding: 1.5rem;
  background: var(--bg-card);
}

.model-card-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  transition: all 0.3s ease;
}

.model-card:hover .model-card-title {
  color: var(--accent);
  transform: translateX(4px);
}

.model-card-location {
  color: var(--text-secondary);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  background: var(--bg-tertiary);
  border-radius: 8px;
  margin-top: 0.5rem;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.model-card:hover .model-card-location {
  background: var(--bg-secondary);
  border-color: var(--accent);
  color: var(--text-primary);
  transform: translateX(4px);
}

.model-card-location::before {
  content: "📍";
  font-size: 1rem;
}

/* Model Viewer Page */
.model-viewer-container {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  display: block;
  overflow: visible;
  min-height: auto;
  border: 1px solid var(--border-color);
}

.model-viewer-container > * {
  position: relative;
  z-index: auto;
}

.model-viewer-wrapper {
  width: 100%;
  height: 500px;
  margin: 2rem 0;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  position: relative;
  display: block;
}

model-viewer {
  width: 100%;
  height: 100%;
  display: block;
}

/* Hide default AR button in model-viewer shadow DOM */
model-viewer::part(default-ar-button),
model-viewer::part(ar-button) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.model-info {
  margin-top: 0;
  margin-bottom: 1rem;
}

.model-title {
  font-size: 2rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.model-description {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.model-location {
  background: var(--bg-tertiary);
  padding: 1rem;
  border-radius: 6px;
  margin-top: 1rem;
  border: 1px solid var(--border-color);
}

.model-location-link {
  display: block;
  text-decoration: none;
  transition: all 0.2s ease;
}

.model-location-link:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(255, 51, 51, 0.2);
}

.model-location h3 {
  color: var(--accent);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.model-location-title::before {
  content: "📍 ";
}

.model-location p {
  color: var(--text-secondary);
}

/* Buttons - Red accent */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn-primary {
  background: var(--accent);
  color: var(--text-primary);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 51, 51, 0.5);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 51, 51, 0.3);
}

.btn-back {
  margin-bottom: 2rem;
  display: inline-block;
}

/* Model Details Section */
.model-details {
  margin-top: 2rem;
  padding-top: 2rem;
  display: block !important;
  width: 100%;
  clear: both;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative;
  z-index: 1;
}

.model-description-section {
  margin-bottom: 2rem;
}

.model-description-section p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.model-description {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.8;
}

/* AR Instructions */
.ar-instructions {
  background: var(--bg-tertiary);
  padding: 1.5rem;
  border-radius: 8px;
  margin-top: 2rem;
  border-left: 4px solid var(--accent);
  border: 1px solid var(--border-color);
}

.ar-instructions h3 {
  color: var(--accent);
  margin-bottom: 1rem;
}

.ar-instructions ul {
  list-style: none;
  padding-left: 0;
}

.ar-instructions li {
  padding: 0.5rem 0;
  color: var(--text-secondary);
}

.ar-instructions li:before {
  content: "→ ";
  color: var(--accent);
  font-weight: bold;
}

/* Photo Confirmation */
.photo-confirmation {
  display: none;
  background: var(--accent);
  color: var(--text-primary);
  padding: 1rem;
  border-radius: 6px;
  margin-top: 1rem;
  text-align: center;
  font-weight: 600;
}

.photo-confirmation.show {
  display: block;
}

/* Share Photo Button Icon (inside model-viewer-wrapper, bottom-left) */
.share-photo-btn-icon {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: var(--accent) !important;
  color: var(--text-primary) !important;
  border: none !important;
  border-radius: 50% !important;
  width: 48px !important;
  height: 48px !important;
  padding: 0 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 4px 12px rgba(255, 51, 51, 0.4) !important;
  transition: all 0.3s ease !important;
  z-index: 10 !important;
}

.share-photo-btn-icon:hover {
  background: var(--accent-hover) !important;
  transform: scale(1.05) !important;
  box-shadow: 0 6px 16px rgba(255, 51, 51, 0.5) !important;
}

.share-photo-btn-icon:active {
  transform: scale(0.95) !important;
}

.share-photo-btn-icon .share-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.share-photo-btn-icon.show-upload-highlight {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25), 0 8px 20px rgba(255, 51, 51, 0.6) !important;
}

@media (max-width: 768px) {
  .share-photo-btn-icon {
    width: 44px !important;
    height: 44px !important;
  }
  
  .share-photo-btn-icon .share-icon {
    width: 20px;
    height: 20px;
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.share-icon {
  display: block;
}

.photo-file-input {
  display: none;
}

.share-success-message,
.share-error-message {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  animation: fadeIn 0.3s ease;
}

.share-success-message {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.share-error-message {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
  border: 1px solid rgba(244, 67, 54, 0.3);
}

/* Share Modal Overlay */
.share-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.share-modal-overlay.hidden {
  display: none;
}

.share-modal-content {
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.9);
  border: 2px solid var(--accent);
  width: calc(100% - 2rem);
  max-width: 1200px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  margin: 1rem;
}

.share-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  padding: 0;
}

.share-modal-close:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

.share-modal-title {
  color: var(--accent);
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  padding-right: 2rem;
}

.share-modal-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.share-modal-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.share-modal-form label {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
}

.share-text-input {
  width: 100%;
  padding: 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  min-height: 100px;
}

#upload-photo-input {
  width: 100%;
  padding: 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
}

.share-text-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 51, 51, 0.1);
}

.checkbox-group {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}

.checkbox-left-align {
  padding-left: 0;
  margin-left: 0;
}

.checkbox-left-align .checkbox-label {
  margin-left: 0;
  padding-left: 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.include-photo-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
}

.checkbox-label span {
  color: var(--text-primary);
  font-weight: normal;
}

.share-modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.share-modal-actions .btn {
  min-width: 100px;
}

.share-modal-content .share-error-message {
  margin-top: 0;
  margin-bottom: 0;
}

.share-modal-content .share-success-message {
  margin-top: 0;
  margin-bottom: 0;
}

.recent-photos-module {
  margin-top: 2rem;
  padding: 1.25rem;
  background: var(--bg-tertiary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.recent-photos-carousel {
  position: relative;
}

.recent-carousel-shell {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
}

.recent-carousel-scroll {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 2.25rem 0.5rem 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}

.recent-carousel-scroll::after {
  content: "";
  flex: 0 0 2rem;
}

.recent-carousel-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
}

.recent-carousel-arrow:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.recent-photo-item {
  min-width: 180px;
  max-width: 220px;
  flex: 0 0 180px;
  scroll-snap-align: start;
}

.recent-photo-open {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.recent-photo-open img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.recent-photo-meta {
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.recent-photo-meta span {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-photo-link {
  font-size: 0.75rem;
  color: var(--accent-light);
  text-decoration: none;
}

.recent-photo-link:hover {
  text-decoration: underline;
}

.recent-carousel-hint {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: opacity 0.3s ease;
}

.recent-carousel-hint::before {
  content: "↔ ";
}

.recent-carousel-hint.seen {
  opacity: 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.9rem;
}

.gallery-grid .recent-photo-item {
  min-width: 0;
  max-width: none;
  flex: 0 0 auto;
}

.gallery-grid .recent-photo-open img {
  height: 180px;
}

body.lightbox-open {
  overflow: hidden;
}

.phillyxr-lightbox {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phillyxr-lightbox.hidden {
  display: none;
}

.phillyxr-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.phillyxr-lightbox-content {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 1100px);
  max-height: 90vh;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
}

.phillyxr-lightbox-image {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.phillyxr-lightbox-caption {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.phillyxr-lightbox-close,
.phillyxr-lightbox-nav {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: rgba(15, 15, 15, 0.8);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.8rem;
}

.phillyxr-lightbox-close {
  position: absolute;
  top: -48px;
  right: 0;
}

.phillyxr-lightbox-nav:hover,
.phillyxr-lightbox-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 768px) {
  .recent-carousel-shell {
    grid-template-columns: 1fr;
  }

  .recent-carousel-arrow {
    display: none;
  }

  .recent-carousel-scroll {
    padding-right: 3.5rem;
  }

  .recent-photo-item {
    flex: 0 0 calc(100% - 4.5rem);
    max-width: calc(100% - 4.5rem);
    min-width: calc(100% - 4.5rem);
  }

  .phillyxr-lightbox-content {
    max-width: 96vw;
    gap: 0.35rem;
  }

  .phillyxr-lightbox-nav {
    width: 36px;
    height: 36px;
    font-size: 1.5rem;
  }

  .phillyxr-lightbox-close {
    top: -42px;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Loading State */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 600;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 2px dashed var(--accent);
}

.loading::before {
  content: "⏳ ";
  display: inline-block;
  margin-right: 0.5rem;
  animation: pulse 1.5s ease-in-out infinite;
  font-size: 1.3rem;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.1); }
}

/* Model Loading Indicator */
.model-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 10;
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
  color: var(--text-primary);
  border: 2px solid var(--accent);
}

.model-loading-spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.model-loading-text {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.model-loading-progress {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
}

/* Duplicate removed - position: relative already set above */

.model-loading.hidden {
  display: none;
}

/* Custom AR Button */
.custom-ar-button {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: var(--accent) !important;
  color: var(--text-primary) !important;
  border: none !important;
  border-radius: 50% !important;
  width: 48px !important;
  height: 48px !important;
  padding: 0 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 4px 12px rgba(255, 51, 51, 0.4) !important;
  transition: all 0.3s ease !important;
  font-family: inherit !important;
  z-index: 10 !important;
}

.custom-ar-button:hover {
  background: var(--accent-hover) !important;
  transform: scale(1.05) !important;
  box-shadow: 0 6px 16px rgba(255, 51, 51, 0.5) !important;
}

.custom-ar-button:active {
  transform: scale(0.95) !important;
}

.custom-ar-button svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .custom-ar-button {
    width: 44px !important;
    height: 44px !important;
  }
  
  .custom-ar-button svg {
    width: 20px;
    height: 20px;
  }
}

/* Error State */
.error {
  background: #ffebee;
  color: #c62828;
  padding: 1rem;
  border-radius: 6px;
  margin: 1rem 0;
}

/* Responsive */
@media (max-width: 768px) {
  header {
    padding: 0.75rem 1rem;
  }
  
  .header-content {
    min-height: 60px;
    padding: 0 0.5rem;
  }
  
  .header-logo {
    height: 100%;
  }

  .menu-toggle {
    right: 0.5rem;
  }

  .public-menu {
    right: 0.5rem;
  }
  
  .btn-back-header {
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
  }
  
  .models-grid {
    grid-template-columns: 1fr;
  }
  
  .model-viewer-wrapper {
    height: 400px;
  }
  
  .model-title {
    font-size: 1.5rem;
  }
  
  .container {
    padding: 1.5rem 1rem;
  }
}

/* Admin Styles */
.admin-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.admin-header {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 1.5rem;
  border-radius: 8px 8px 0 0;
  margin-bottom: 0;
  border-bottom: 2px solid var(--accent);
}

.admin-content {
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  color: var(--text-primary);
}

.admin-form {
  margin-top: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-card);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.models-list {
  margin-top: 2rem;
}

.model-item {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border-color);
}

.model-item-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.model-item-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
}

.model-item-details h3 {
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.model-item-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.btn-danger {
  background: #c62828;
  color: var(--text-primary);
}

.btn-danger:hover {
  background: #b71c1c;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .model-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .model-item-actions {
    width: 100%;
    margin-top: 1rem;
  }
  
  .model-item-actions .btn {
    flex: 1;
  }
}

/* Admin Loading Overlay */
.admin-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.admin-loading-content {
  background: var(--bg-secondary);
  padding: 3rem;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.9);
  text-align: center;
  border: 2px solid var(--accent);
  min-width: 300px;
  max-width: 90%;
}

.admin-loading-overlay.hidden {
  opacity: 0;
  transition: opacity 0.3s ease-out;
  pointer-events: none;
}