/* AR Mersin - Modern Dark Theme */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a25;
  --bg-card-hover: #252535;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --accent-color: #667eea;
  --border-color: #2a2a3a;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.header {
  background: var(--accent-gradient);
  padding: 24px 20px;
  text-align: center;
}

.header-title {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 4px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-subtitle {
  font-size: 0.9rem;
  font-weight: 400;
  opacity: 0.9;
}

/* Welcome Modal */
.welcome-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.3s ease;
}

.welcome-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  max-width: 360px;
  text-align: center;
  border: 1px solid var(--border-color);
}

.welcome-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.welcome-content h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.welcome-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.welcome-steps {
  list-style: none;
  text-align: left;
  margin-bottom: 24px;
}

.welcome-steps li {
  padding: 8px 0;
  font-size: 0.85rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}

.welcome-steps li:last-child {
  border-bottom: none;
}

/* Gallery */
.gallery {
  flex: 1;
  padding: 24px 16px;
  background: var(--bg-primary);
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
}

@media (min-width: 600px) {
  .model-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 900px) {
  .model-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Model Card */
.model-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.model-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  border-color: var(--accent-color);
}

.model-thumbnail {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  color: var(--text-secondary);
}

.model-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.model-info {
  padding: 12px;
}

.model-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
  text-align: center;
}

.model-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 8px;
  opacity: 0.8;
}

/* ==========================================================================
   2. Landing Page & New Styles
   ========================================================================== */

/* Fonts */
:root {
  --font-heading: 'Cinzel', serif;
  --font-body: 'Inter', sans-serif;
  --color-gold: #D4AF37;
  --color-dark: #1a1a2e;
  --color-light: #f5f5f5;
  --color-surface: rgba(255, 255, 255, 0.1);
  --glass: blur(10px);
}

.landing-body {
  /* background image moved to inline style for better path handling */
  background-color: #1a1a2e;
  height: 100vh;
  display: flex;
  flex-direction: column;
  color: white;
  overflow: hidden;
}

.hero-content {
  text-align: center;
  margin-top: auto;
  margin-bottom: auto;
  padding: 2rem;
  animation: fadeIn 1s ease-out;
}

.logo-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--color-gold);
  margin: 0 auto 1.5rem;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

.hero-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--color-gold);
  line-height: 1.2;
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.hero-subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 3rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.landing-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 400px;
  margin: 0 auto;
}

.btn-landing {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 1.2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: transform 0.2s, box-shadow 0.2s;
  backdrop-filter: var(--glass);
}

.btn-landing.primary {
  background: linear-gradient(45deg, var(--color-gold), #F4E285);
  color: var(--color-dark);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-landing.secondary {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
}

.btn-landing:active {
  transform: scale(0.98);
}

/* Language Toggle */
.lang-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 5px;
  background: rgba(0,0,0,0.5);
  padding: 5px;
  border-radius: 20px;
  z-index: 10;
}

.lang-btn {
  background: none;
  border: none;
  color: white;
  padding: 5px 12px;
  border-radius: 15px;
  cursor: pointer;
  font-size: 0.8rem;
  opacity: 0.6;
}

.lang-btn.active {
  background: white;
  color: black;
  opacity: 1;
}

/* Info Page & Grid */
.info-container {
  padding: 80px 20px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}

.info-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.2s;
}

.info-card:hover {
  transform: translateY(-5px);
}

.card-img-wrapper {
  height: 140px;
  overflow: hidden;
}

.card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-content {
  padding: 12px;
}

.card-content h3 {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  margin-bottom: 5px;
  color: var(--color-dark);
}

.card-content p {
  font-size: 0.8rem;
  color: #666;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more {
  display: block;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--color-gold);
  font-weight: 600;
}

/* Info Modal */
.info-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.info-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: white;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  border-radius: 20px;
  overflow-y: auto;
  position: relative;
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  z-index: 10;
}

.modal-image-container {
  width: 100%;
  height: 250px;
}

.modal-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-text {
  padding: 25px;
}

.modal-text h2 {
  font-family: var(--font-heading);
  color: var(--color-dark);
  margin-bottom: 15px;
  font-size: 1.5rem;
}

.modal-text p {
  line-height: 1.6;
  color: #444;
}

/* Header Update */
.btn-back-home {
  color: white;
  opacity: 0.8;
  margin-right: 15px;
}

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

/* iOS Option Buttons */
.ios-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.ios-option-btn {
  background: var(--accent-gradient);
  border: none;
  color: white;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.ios-option-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.ios-option-btn .opt-label {
  font-size: 0.9rem;
}

.ios-option-btn .opt-desc {
  font-size: 0.7rem;
  opacity: 0.9;
}

.model-actions {
  display: flex;
  gap: 8px;
}

.btn {
  flex: 1;
  padding: 10px 8px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-icon {
  font-size: 1rem;
}

.btn-ar {
  background: var(--accent-gradient);
  color: white;
}

.btn-ar:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.btn-preview {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-preview:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--accent-color);
}

.btn-large {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-full {
  width: 100%;
}

/* Footer */
.footer {
  padding: 40px 20px;
  text-align: center;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.footer p {
  margin: 4px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer a {
  color: var(--accent-color);
  text-decoration: none;
  transition: opacity 0.3s;
}

.footer a:hover {
  opacity: 0.7;
}

.footer-copyright {
  opacity: 0.6;
}

/* Clear Cache Button */
.btn-clear-cache {
  margin-top: 16px;
  padding: 10px 20px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-clear-cache:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--accent-color);
}

/* AR Page Styles */
.ar-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
}

.ar-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-back {
  background: rgba(255,255,255,0.15);
  color: white;
  padding: 10px 16px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-back:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.4);
}

.btn-back svg {
  width: 18px;
  height: 18px;
}

.ar-model-name {
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
}

model-viewer {
  width: 100%;
  height: 100%;
}

model-viewer::part(default-ar-button) {
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  padding: 12px 24px;
}

/* Loading Overlay */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 0.3s ease;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.loading-percent {
  margin-top: 8px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
}

/* Preview Modal */
.preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  transition: opacity 0.3s ease;
}

.preview-header {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.preview-content {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-content model-viewer {
  width: 100%;
  height: 100%;
}

.preview-footer {
  padding: 16px;
  background: var(--bg-secondary);
  text-align: center;
  border-top: 1px solid var(--border-color);
}

/* ====================================
   LANDING PAGE STYLES
   ==================================== */

.landing-body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
}

.landing-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 20px 60px 20px; /* Extra bottom padding for fixed footer */
  text-align: center;
}

.hero-content {
  max-width: 600px;
  width: 100%;
}

.logo-circle {
  width: 150px;
  height: 150px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-logo-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.hero-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  font-weight: 700;
  color: white;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
  margin-bottom: 8px;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: clamp(0.9rem, 2.5vw, 1.3rem);
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  margin-bottom: 20px;
}

/* Language Toggle */
.lang-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  gap: 8px;
  background: rgba(10, 10, 20, 0.6);
  backdrop-filter: blur(10px);
  padding: 6px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.lang-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 20px;
  transition: all 0.3s ease;
}

.lang-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.lang-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

/* Landing Buttons */
.landing-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.btn-landing {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  border: 2px solid transparent;
}

.btn-landing .btn-icon {
  font-size: 1.5rem;
}

.btn-landing.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-landing.primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-landing.secondary {
  background: rgba(10, 10, 20, 0.7);
  backdrop-filter: blur(10px);
  color: white;
  border-color: rgba(102, 126, 234, 0.5);
}

.btn-landing.secondary:hover {
  transform: translateY(-4px);
  background: rgba(10, 10, 20, 0.85);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  border-color: rgba(102, 126, 234, 0.8);
}

.btn-landing.survey {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.btn-landing.survey:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(16, 185, 129, 0.5);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Footer */
.landing-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  padding: 20px;
  text-align: center;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;
}

.landing-footer p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  margin: 0;
}

.footer-link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: rgba(255, 255, 255, 1);
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 600px) {
  .landing-body {
    min-height: 100dvh; /* Dynamic viewport height for mobile */
  }
  
  .landing-container {
    padding: 5px 16px 5px 16px;
  }
  
  .logo-circle {
    width: 80px;
    height: 80px;
    margin: 0 auto 8px;
  }
  
  .hero-title {
    margin-bottom: 4px;
    font-size: 1.5rem;
  }
  
  .hero-subtitle {
    margin-bottom: 12px;
    font-size: 0.85rem;
  }
  
  .landing-buttons {
    max-width: 100%;
    gap: 8px;
  }
  
  .btn-landing {
    font-size: 0.8rem;
    padding: 10px 16px;
    gap: 6px;
  }
  
  .btn-landing .btn-icon {
    font-size: 1.1rem;
  }
  
  .landing-footer {
    padding: 8px 16px 10px 16px;
  }
  
  .landing-footer p {
    font-size: 0.75rem;
  }
}
