*, *::before, *::after { 
  box-sizing: border-box; 
}

html, body { 
  margin: 0; 
  padding: 0; 
  scroll-behavior: smooth;
}

:root {
  --bg: #0b0c10;
  --text: #e5e7eb;
  --muted: #9aa0a6;
  --card: #111317;
  --primary: #60a5fa;
  --primary-contrast: #0b0c10;
  --border: #23262d;
  --shadow: 0 10px 30px rgba(0,0,0,0.25);
  --shadow-hover: 0 12px 40px rgba(0,0,0,0.3);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 14px;
  --transition: all 0.3s ease;
  --font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --sidebar-width: 240px;
  --about-spacing: clamp(30px, 6vw, 50px);
}

.light {
  --bg: #ffffff;
  --text: #0b0c10;
  --muted: #4b5563;
  --card: #f5f7fb;
  --primary: #2563eb;
  --primary-contrast: #ffffff;
  --border: #e5e7eb;
  --shadow: 0 8px 24px rgba(0,0,0,0.1);
  --shadow-hover: 0 12px 32px rgba(0,0,0,0.15);
}

body {
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.sidebar-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1001;
  background: var(--primary);
  color: var(--primary-contrast);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.sidebar-toggle:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-hover);
}

.sidebar-toggle .hamburger {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 20px;
  height: 16px;
  align-items: flex-start;
}

.sidebar-toggle .hamburger .line {
  background: currentColor;
  height: 2px;
  border-radius: 1px;
  transition: width 0.6s ease;
}

.sidebar-toggle:hover .hamburger .line:nth-child(1),
.sidebar-toggle:hover .hamburger .line:nth-child(2),
.sidebar-toggle:hover .hamburger .line:nth-child(3) {
  width: 20px;
}

.sidebar-toggle .hamburger .line:nth-child(1) {
  width: 20px;
}

.sidebar-toggle .hamburger .line:nth-child(2) {
  width: 20px;
}

.sidebar-toggle .hamburger .line:nth-child(3) {
  width: 20px;
}

.sidebar.open + .sidebar-toggle .hamburger .line:nth-child(1),
body:has(.sidebar.open) .sidebar-toggle .hamburger .line:nth-child(1) {
  width: 20px;
}

.sidebar.open + .sidebar-toggle .hamburger .line:nth-child(2),
body:has(.sidebar.open) .sidebar-toggle .hamburger .line:nth-child(2) {
  width: 15px;
}

.sidebar.open + .sidebar-toggle .hamburger .line:nth-child(3),
body:has(.sidebar.open) .sidebar-toggle .hamburger .line:nth-child(3) {
  width: 10px;
}

.sidebar {
  position: fixed;
  top: 0;
  left: -240px;
  width: var(--sidebar-width);
  height: 100vh;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: left 0.3s ease;
  overflow-y: auto;
  background: rgba(17, 19, 23, 0.95);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(96, 165, 250, 0.2);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

.sidebar.open {
  left: 0;
}

.light .sidebar {
  background: rgba(255, 255, 255, 0.95);
  border-right: 1px solid rgba(37, 99, 235, 0.2);
}

.sidebar-header {
  padding: 30px 20px 20px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text);
  text-align: right;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
  border-left: 3px solid transparent;
}

.nav-link i {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.nav-link:hover {
  background: color-mix(in oklab, var(--primary), transparent 90%);
  border-left-color: var(--primary);
}

.nav-link.active {
  background: color-mix(in oklab, var(--primary), transparent 85%);
  border-left-color: var(--primary);
  color: var(--primary);
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border);
}

.background-selector {
  margin-top: 15px;
}

.background-selector label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--muted);
}

.background-selector select {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
}

.floating-name {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
  transition: all 0.8s ease;
  background: transparent;
  padding: 0;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

.floating-name.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.floating-name h2 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--text);
  text-align: right;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.persistent-icons {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 1;
  visibility: visible;
  transition: var(--transition);
}

.persistent-icons button,
.persistent-icons a {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: var(--shadow);
  font-size: 20px;
}

#persistentThemeToggle {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}

#persistentThemeToggle:hover {
  background: color-mix(in oklab, var(--card), var(--primary) 10%);
  transform: scale(1.1);
}

.persistent-icon {
  background: var(--primary);
  color: var(--primary-contrast);
}

.persistent-icon:hover {
  background: color-mix(in oklab, var(--primary), white 10%);
  transform: scale(1.1);
}

.main-content {
  margin-left: 0;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

.container {
  width: min(100%, 1200px);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 40px);
}

.hero {
  padding: clamp(80px, 15vw, 150px) 0 clamp(60px, 10vw, 100px);
  text-align: center;
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.hero h1 { 
  font-size: clamp(2.5rem, 7vw, 4rem); 
  margin: 0 0 20px; 
  font-weight: 800;
  background: linear-gradient(135deg, var(--text), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p { 
  color: var(--muted); 
  margin: 0 auto 40px; 
  max-width: 720px; 
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  line-height: 1.7;
}

.cta-group { 
  display: flex;
  gap: 16px; 
  flex-wrap: wrap; 
  justify-content: center;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--primary);
  color: var(--primary-contrast);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.button:hover::before {
  left: 100%;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  background: color-mix(in oklab, var(--primary), white 10%);
}

.button.secondary {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
}

.button.secondary:hover {
  background: color-mix(in oklab, var(--text), transparent 90%);
  color: var(--primary);
  border-color: var(--primary);
}

.button.social {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}

.button.social:hover {
  background: var(--primary);
  color: var(--primary-contrast);
  border-color: var(--primary);
}

.section {
  padding: var(--about-spacing) 0;
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s ease;
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section h2 { 
  font-size: clamp(2rem, 5vw, 2.5rem); 
  margin: 0 0 30px; 
  text-align: center;
  position: relative;
  z-index: 5;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 40px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.about-card:nth-child(1) {
  transform: translateY(30px);
}

.about-card:nth-child(2) {
  transform: translateY(0px);
}

.about-card:nth-child(3) {
  transform: translateY(-30px);
}

.about-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: all 0.6s ease;
  display: flex;
  flex-direction: column;
  opacity: 1;
  position: relative;
}

.about-card.visible {
  opacity: 1;
}

.about-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
}

.about-card h3 { 
  margin: 0 0 12px; 
  font-size: 1.5rem; 
  color: var(--text);
}

.about-card p { 
  margin: 0; 
  color: var(--muted);
  flex: 1;
  line-height: 1.6;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.card:nth-child(1) {
  transform: translateY(20px);
}

.card:nth-child(2) {
  transform: translateY(-20px);
}

.card:nth-child(3) {
  transform: translateY(10px);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: all 0.6s ease;
  display: flex;
  flex-direction: column;
  opacity: 1;
  position: relative;
}

.card.visible {
  opacity: 1;
}

.card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
}

.card h3 { 
  margin: 0 0 12px; 
  font-size: 1.5rem; 
  color: var(--text);
}

.card p { 
  margin: 0 0 20px; 
  color: var(--muted);
  flex: 1;
  line-height: 1.6;
}

.card .button {
  align-self: flex-start;
  font-size: 0.95rem;
  padding: 10px 20px;
}

.projects-hero {
  padding: clamp(60px, 12vw, 100px) 0 clamp(40px, 8vw, 60px);
  text-align: center;
  background: linear-gradient(135deg, color-mix(in oklab, var(--primary), transparent 90%), transparent);
  border-bottom: 1px solid var(--border);
}

.projects-hero h1 {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  margin: 0 0 16px;
  color: var(--text);
}

.projects-hero p {
  font-size: clamp(1.1rem, 2.5vw, 1.25rem);
  color: var(--muted);
  max-width: 700px;
  margin: 0 auto;
}

.project-detail {
  padding: clamp(60px, 10vw, 80px) 0;
  border-bottom: 1px solid var(--border);
}

.project-detail:last-of-type {
  border-bottom: none;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

.project-header h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.5rem);
  text-align: left;
}

.project-links {
  display: flex;
  gap: 12px;
}

.project-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow);
}

.project-description h3 {
  font-size: 1.5rem;
  margin: 30px 0 15px 0;
  color: var(--primary);
}

.project-description h3:first-child {
  margin-top: 0;
}

.project-description p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 20px;
}

.project-description ul {
  margin: 15px 0;
  padding-left: 25px;
}

.project-description li {
  margin-bottom: 12px;
  line-height: 1.6;
  color: var(--text);
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.tech-tag {
  background: color-mix(in oklab, var(--primary), transparent 85%);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid color-mix(in oklab, var(--primary), transparent 70%);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.metric {
  text-align: center;
  padding: 20px;
  background: color-mix(in oklab, var(--primary), transparent 90%);
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in oklab, var(--primary), transparent 70%);
}

.metric h4 {
  font-size: 2.5rem;
  margin: 0 0 8px 0;
  color: var(--primary);
}

.metric p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 30px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.75rem;
  color: var(--text);
}

.modal-close {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.modal-close:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
  transform: scale(1.1);
}

.modal-form {
  padding: 30px;
  display: grid;
  gap: 20px;
}

.modal-form label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
}

.modal-form input,
.modal-form textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  transition: var(--transition);
  font-family: inherit;
}

.modal-form input:focus,
.modal-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary), transparent 80%);
}

.modal-form input::placeholder,
.modal-form textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

#formStatus {
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-weight: 500;
  transition: var(--transition);
}

.status-success {
  background: color-mix(in oklab, #10b981, transparent 90%);
  color: #10b981;
  border: 1px solid color-mix(in oklab, #10b981, transparent 70%);
}

.status-error {
  background: color-mix(in oklab, #ef4444, transparent 90%);
  color: #ef4444;
  border: 1px solid color-mix(in oklab, #ef4444, transparent 70%);
}

.status-info {
  background: color-mix(in oklab, var(--primary), transparent 90%);
  color: var(--primary);
  border: 1px solid color-mix(in oklab, var(--primary), transparent 70%);
}

.site-footer { 
  border-top: 1px solid var(--border); 
  margin-top: 60px;
}

.site-footer .container { 
  padding: 30px clamp(20px, 5vw, 40px); 
  text-align: center; 
  color: var(--muted);
}

@media (max-width: 768px) {
  .hero {
    min-height: 60vh;
  }
  
  .cta-group {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }
  
  .button {
    width: 100%;
    justify-content: center;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .about-content {
    padding: 30px 25px;
  }

  .project-content {
    padding: 30px 20px;
  }

  .project-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .sidebar {
    width: 100%;
    left: -100%;
  }

  .sidebar-toggle {
    width: 45px;
    height: 45px;
    font-size: 18px;
  }

  .about-content {
    padding: 25px 20px;
  }

  .modal-content {
    width: 95%;
  }

  .modal-header {
    padding: 20px 20px 15px;
  }

  .modal-form {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .button::before,
  .modal {
    animation: none;
  }
  
  .button:hover {
    transform: none;
  }
}

@media (prefers-contrast: high) {
  :root {
    --border: #ffffff;
    --shadow: 0 0 0 2px #ffffff;
  }
  
  .light {
    --border: #000000;
    --shadow: 0 0 0 2px #000000;
  }
}

.room-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

.room-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: default;
}

.room-canvas.measure-mode {
  cursor: crosshair;
}

.room-controls-panel {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(17, 19, 23, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  min-width: 250px;
  max-width: 300px;
}

.light .room-controls-panel {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.room-controls-panel h3 {
  margin: 0 0 15px 0;
  font-size: 1.2rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-control-group {
  margin-bottom: 15px;
}

.room-control-group:last-child {
  margin-bottom: 0;
}

.room-control-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
}

.room-control-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
  width: 100%;
  margin-bottom: 8px;
  font-family: inherit;
}

.room-control-button:hover {
  background: color-mix(in oklab, var(--primary), transparent 90%);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.room-control-button.active {
  background: var(--primary);
  color: var(--primary-contrast);
  border-color: var(--primary);
}

.room-control-button i {
  width: 16px;
  text-align: center;
}

.room-control-select {
  width: 100%;
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
}

.room-control-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--primary), transparent 80%);
}

.room-performance-overlay {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(17, 19, 23, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: var(--radius);
  padding: 15px;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: var(--text);
  z-index: 1000;
  min-width: 150px;
  max-width: 200px;
}

.light .room-performance-overlay {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.room-performance-overlay.hidden {
  display: none;
}

.room-performance-metric {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  align-items: center;
}

.room-performance-metric:last-child {
  margin-bottom: 0;
}

.room-performance-metric .label {
  color: var(--muted);
  font-size: 0.75rem;
}

.room-performance-metric .value {
  color: var(--primary);
  font-weight: bold;
  font-size: 0.8rem;
}

.room-loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  transition: opacity 0.5s ease;
}

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

.room-loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: room-spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes room-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.room-loading-text {
  color: var(--muted);
  font-size: 1.1rem;
  margin-bottom: 10px;
  text-align: center;
}

.room-loading-progress {
  width: 200px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 10px;
}

.room-loading-progress-bar {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 2px;
}

.room-back-button {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 1001;
  background: var(--primary);
  color: var(--primary-contrast);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  text-decoration: none;
}

.room-back-button:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-hover);
  background: color-mix(in oklab, var(--primary), white 10%);
}

.room-info-panel {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: rgba(17, 19, 23, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: var(--radius-lg);
  padding: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  max-width: 300px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.light .room-info-panel {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.room-info-panel.visible {
  opacity: 1;
  transform: translateY(0);
}

.room-info-panel h4 {
  margin: 0 0 8px 0;
  font-size: 1rem;
  color: var(--text);
  font-weight: 600;
}

.room-info-panel p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

.room-measurement-line {
  position: absolute;
  pointer-events: none;
  z-index: 999;
}

.room-measurement-line::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  box-shadow: 0 0 4px rgba(96, 165, 250, 0.5);
}

.room-measurement-line::after {
  content: attr(data-distance);
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: var(--primary-contrast);
  padding: 4px 8px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: bold;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .room-controls-panel {
    top: 80px;
    left: 10px;
    right: 10px;
    min-width: auto;
    max-width: none;
  }

  .room-performance-overlay {
    top: 80px;
    right: 10px;
    left: 10px;
    min-width: auto;
    max-width: none;
  }

  .room-info-panel {
    bottom: 10px;
    left: 10px;
    right: 10px;
    max-width: none;
  }

  .room-back-button {
    top: 10px;
    left: 10px;
    width: 45px;
    height: 45px;
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .room-controls-panel {
    padding: 15px;
  }

  .room-controls-panel h3 {
    font-size: 1.1rem;
  }

  .room-control-button {
    padding: 6px 10px;
    font-size: 0.85rem;
  }

  .room-performance-overlay {
    padding: 12px;
    font-size: 0.75rem;
  }

  .room-info-panel {
    padding: 12px;
  }

  .room-info-panel h4 {
    font-size: 0.95rem;
  }

  .room-info-panel p {
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .room-loading-spinner {
    animation: none;
  }
  
  .room-info-panel,
  .room-controls-panel,
  .room-performance-overlay {
    transition: none;
  }

  .room-control-button:hover {
    transform: none;
  }

  .room-back-button:hover {
    transform: none;
  }
}

@media (prefers-contrast: high) {
  .room-controls-panel,
  .room-performance-overlay,
  .room-info-panel {
    border-width: 2px;
  }

  .room-control-button {
    border-width: 2px;
  }

  .room-control-button.active {
    border-width: 3px;
  }
}
