:root {
  --primary-color: #2563eb; /* Vibrant Cobalt Blue */
  --primary-hover: #1d4ed8;
  --bg-color: #f8fafc; /* Soft Slate Off-White */
  --card-bg: rgba(255, 255, 255, 0.85); /* White glass */
  --text-main: #0f172a; /* Slate 900 */
  --text-muted: #475569; /* Slate 600 */
  --border-color: rgba(15, 23, 42, 0.08); /* Soft slate border */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.06);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top right, #eff6ff, #f8fafc);
}

/* Glassmorphism Header */
.global-header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.header-brand {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(to right, #2563eb, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
}

.header-nav {
  display: flex;
  gap: 1.5rem;
}

.header-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.header-nav a:hover, .header-nav a.active {
  color: var(--text-main);
}

/* Main Content Area */
.container {
  max-width: 100%;
  margin: 0;
  padding: 1rem 1.5rem;
  flex: 1;
  width: 100%;
}

/* Glass Card */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-muted);
}

input[type="text"], input[type="number"], select {
  width: 100%;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.15);
  border-radius: 0.75rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1.1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus, input[type="number"]:focus, select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background-color 0.2s, transform 0.1s;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

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

/* Loading Overlay */
.loading-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 1rem;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.loading-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(15, 23, 42, 0.05);
  border-left-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

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

/* Feedback Buttons */
.feedback-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-right: 1rem;
    display: none; /* Hidden until a model is generated */
}

.feedback-btn {
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-btn.up {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
}

.feedback-btn.down {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

.feedback-btn:hover {
    transform: translateY(-2px);
}

.feedback-btn.up:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
}

.feedback-btn.down:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.feedback-btn.active.up {
    background: #22c55e;
    color: white;
}

.feedback-btn.active.down {
    background: #ef4444;
    color: white;
}

/* 3D Viewer Container */
.viewer-container {
  width: 100%;
  height: 700px;
  background: #ffffff;
  border-radius: 1rem;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  margin-top: 1rem;
  box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.03);
}

/* Site Footer */
.site-footer {
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

.footer-links {
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 0.5rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #f472b6;
}
@media (max-width: 640px) {
    .global-header {
        padding: 1rem;
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
        text-align: center;
    }
    .header-brand {
        margin-bottom: 0.25rem;
    }
    .header-nav {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
        gap: 1.25rem;
        padding-bottom: 0.5rem;
        width: 100%;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }
    .header-nav::-webkit-scrollbar {
        display: none; /* Safari and Chrome */
    }
    .header-nav a {
        flex: 0 0 auto;
        font-size: 0.95rem;
        padding: 0.25rem 0;
    }
    .container {
        padding: 0.75rem;
    }
    .glass-card {
        padding: 1.25rem;
        border-radius: 1rem;
    }
    h2 {
        font-size: 1.3rem;
    }
}
