/* Base Styles */
:root {
  --primary-color: #1d9bf0;
  --secondary-color: #00ba7c;
  --accent-color: #f91880;
  --dark-color: #000000;
  --light-color: #16181c;
  --text-color: #e7e9ea;
  --text-primary: #e7e9ea;
  --text-muted: #71767b;
  --border-color: #2f3336;
  --hover-color: #1a1d23;
  --hover-bg: rgba(255, 255, 255, 0.05);
  --input-bg: #202327;
  --panel-bg: rgba(30, 30, 30, 0.6);
  --card-bg: rgba(30, 30, 30, 0.6);
  --border-radius: 16px;
  --box-shadow: 0 2px 8px rgba(255, 255, 255, 0.03);
  --transition: all 0.2s ease;
  --success-color: #00ba7c;
  --success-light: rgba(0, 186, 124, 0.1);
  --success-dark: #009963;
  --error-color: #f91880;
  --error-light: rgba(249, 24, 128, 0.1);
  --warning-color: #ffc107;
  --warning-light: rgba(255, 193, 7, 0.1);
  --info-color: #1d9bf0;
  --primary-light: rgba(29, 155, 240, 0.1);
  --white: #ffffff;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--dark-color);
}

/* Global site background (match landing page) so glass panels show the same image across all pages */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: url('/static/images/background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Dark gradient overlay to match site tone.
   Apply the dark overlay on all pages EXCEPT the landing page so the landing background
   can remain bright while other pages keep the darker tone for legibility. */
body:not(.landing-page)::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, rgba(0,0,0,0.8), rgba(0,0,0,0.6));
}

/* Landing page overlay - make it brighter than the global overlay so the background image is more visible.
   User requested the landing hero be brighter like other pages. Adjusted per user preference. */
.landing-page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: linear-gradient(135deg, rgba(0,0,0,0.08), rgba(0,0,0,0.03));
}

/* Landing page — brighten headings while keeping small body copy slightly darker
   so it offsets the bold pure-white headings for better visual hierarchy. */
body.landing-page .hero-content h2,
body.landing-page header p,
body.landing-page .features-section h2,
body.landing-page .feature-card h3,
body.landing-page .membership-header h2 {
  color: #ffffff !important;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.55) !important;
  opacity: 1 !important;
}

/* Small body text on landing should be a bit darker (not pure white) to offset headings.
   Include use-case card body text, the AI models section, membership header and CTA body so they match the feature cards above. */
body.landing-page .hero-description,
body.landing-page .feature-card p,
body.landing-page .use-case p,
body.landing-page .ai-models-section p,
body.landing-page .ai-models-content p,
body.landing-page .membership-header p,
body.landing-page .cta-content p {
  /* Increase brightness slightly so these two sections match the adjusted card copy */
  color: #ececec !important;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.55) !important;
  opacity: 0.99 !important;
}

/* Reduce hero spacing on landing so the "Professional Creative Studio..." section sits higher.
   Adjust padding and min-height; tweak margin-top to pull the block up slightly behind the header. */
body.landing-page .hero-section {
  padding: 20px 0 20px !important;
  min-height: auto !important;
  margin-top: 0 !important;
}

/* Slightly tighten the inner hero-content spacing to keep headings and paragraph closer together */
body.landing-page .hero-content {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3, h4 {
  margin-bottom: 15px;
  color: var(--text-color);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: #217dbb;
}

/* Header Styles */

/* Glass panel (site-wide) - make containers use the landing page semi-transparent blurred background */
[class*="panel"], [class*="section"], [class*="card"], [class*="box"], .upload-section, .preview-panel, .options-panel, .generator-panel, .tool-card, .feature-card, .prompt-output, .membership-plan, .revisions-list, .revision-card, .prompt-container, .empty-state,
.main-panel, main .generator-panel, main .options-panel, main .preview-panel, main .upload-section, main .image-preview, main .file-preview, main .multiple-files-container, main .uploaded-file-item, .history-card, .membership-plan, .tool-card, .feature-card {
  background: var(--panel-bg) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

/* Ensure inner panels keep sufficient contrast */
[class*="panel"] h2,
[class*="panel"] h3,
[class*="section"] h2,
[class*="card"] h3,
main .generator-panel h2,
main .options-panel h2,
main .preview-panel h2 {
  color: var(--text-color);
}

/* Override solid input-bg backgrounds inside main content so glass shows through.
   This block is intentionally broad and uses !important to override inline styles
   on templates (e.g. pages like 3d_generator, relief_generator, depthmap). */
main .container [style*="background: var(--input-bg)"],
main .container [style*="background: var(--card-bg)"],
main .container [style*="background: var(--panel-bg)"],
main .container [style*="background: var(--border-color)"],
main .container [style*="background: white"],
main .container .input-bg,
main .container .file-upload-area,
main .container .image-preview,
main .container .uploaded-file-item,
main .container .multiple-files-container,
main .container .prompt-output,
.control-group[style],
.quality-selector[style],
.background-info[style],
.preview-panel[style],
.tools-grid[style] {
  /* Force the landing-style glass look and override inline backgrounds */
  background: linear-gradient(rgba(20,20,20,0.45), rgba(20,20,20,0.45)) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--border-radius) !important;
  box-shadow: var(--box-shadow) !important;
  color: var(--text-color) !important;
}

/* Force nav container + nav pills and all buttons to be glass (override inline and per-page rules) */
header .container,
.header-nav .nav-link,
.header-nav .nav-link[style],
.auth-menu .nav-link,
.auth-menu .nav-link[style],
.nav-link,
.nav-link[style],
.btn,
.btn[style],
.btn-primary,
.btn-secondary,
.mode-badge,
.preset-btn,
.user-info,
.tool-card,
.feature-card,
.header-nav .button-group {
  background: var(--panel-bg) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--border-radius) !important;
  color: var(--text-color) !important;
}

/* Ensure primary/secondary buttons keep their accent via border/text while staying glass */
.btn-primary,
.btn-primary[style] {
  background: var(--panel-bg) !important;
  border-color: var(--primary-color) !important;
  color: var(--text-color) !important;
}

.btn-secondary,
.btn-secondary[style] {
  background: var(--panel-bg) !important;
  border-color: var(--secondary-color) !important;
  color: var(--text-color) !important;
}

/* Stronger hover for these forced glass items */
header .container .nav-link:hover,
.btn:hover,
.mode-badge:hover,
.preset-btn:hover {
  background: linear-gradient(rgba(30,30,30,0.75), rgba(30,30,30,0.6)) !important;
  border-color: var(--primary-color) !important;
  transform: translateY(-2px) !important;
}
header {
  background: transparent !important;
  color: var(--text-color);
  padding: 20px 0;
  margin-bottom: 30px;
  border: none !important;
  box-shadow: none !important;
}

/* Make the header container fully transparent (far-back wrapper) on all pages.
   Keep the nav pills (.header-nav .nav-link) as semi-transparent glass. */
header .container {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
}

.header-logo .logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  align-self: center;
}

header h1 {
  color: white;
  margin-bottom: 5px;
}

header p {
  opacity: 0.8;
  margin-bottom: 15px;
}

/* Header Navigation */
/* The header navigation group itself must be 100% transparent (no back panel).
   Only the individual nav pills / buttons should render as semi-transparent glass.
   This rule forces all common header-nav wrapper variants to be fully transparent. */
.header-nav,
.header-nav > div,
.header-nav .nav-row,
.header-nav .nav-group,
.header-nav .button-group,
.header-nav .nav-wrapper,
header .container > .header-nav,
header .container > .header-nav > div {
  display: flex;
  gap: 20px;
  margin-top: 15px;
  align-items: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 100;

  /* Force the wrapper to be fully transparent so only the buttons show glass */
  background: transparent !important;
  background-image: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

.nav-link {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--panel-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-color);
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
  min-width: 100px;
  justify-content: center;
  height: 40px !important;
  line-height: 1 !important;
  box-sizing: border-box;
  outline: none;
  vertical-align: middle !important;
  margin: 0 !important;
}

.nav-link:hover {
  background: linear-gradient(rgba(30,30,30,0.65), rgba(30,30,30,0.6));
  color: var(--text-color);
  transform: translateY(-2px);
  border-color: var(--primary-color);
}

.nav-link:focus,
.nav-link:active {
  outline: none !important;
  box-shadow: none !important;
}

/* Ensure all button-like UI (nav pills, mode badges, preset buttons, and general .btn) use the same "glass" panel styling
   so navigation/button groups are semi-transparent and blurred like the landing page. */
.btn,
.button-group .btn,
.nav-link,
.auth-menu .nav-link,
.header-nav .nav-link,
.mode-badge,
.preset-btn,
.preset-info,
.user-info,
.tool-card .btn,
.feature-card .btn {
  background: var(--panel-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-color);
}

/* Slightly stronger hover for button-like items */
.btn:hover,
.button-group .btn:hover,
.mode-badge:hover,
.preset-btn:hover,
.auth-menu .nav-link:hover,
.header-nav .nav-link:hover {
  background: linear-gradient(rgba(30,30,30,0.7), rgba(30,30,30,0.6));
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.nav-link.active {
  background-color: var(--primary-color);
  color: white;
}

.nav-link.active:hover {
  background-color: #217dbb;
  color: white;
}

.nav-link i {
  font-size: 16px;
}

/* User Menu Styles */
.user-menu, .auth-menu {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-left: auto;
}

.user-info {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--panel-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-color);
  font-weight: 500;
  font-size: 14px;
  height: 40px !important;
  line-height: 1 !important;
  white-space: nowrap;
  box-sizing: border-box;
  outline: none;
  vertical-align: middle !important;
  margin: 0 !important;
}

.user-info i {
  color: var(--primary-color);
}

.user-info:focus,
.user-info:active {
  outline: none !important;
  box-shadow: none !important;
}

.auth-menu .nav-link {
  background: var(--panel-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

.auth-menu .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Legacy nav styles for compatibility */
nav ul {
  display: flex;
  list-style: none;
}

nav ul li {
  margin-right: 20px;
}

nav ul li a {
  color: white;
  padding: 5px 0;
  position: relative;
}

nav ul li a:hover {
  color: var(--primary-color);
}

nav ul li a.active {
  color: var(--primary-color);
}

nav ul li a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary-color);
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-color);
}

.form-control {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 16px;
  transition: var(--transition);
  background-color: rgba(32, 35, 39, 0.5);
  color: var(--text-color);
}

.form-control:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 2px rgba(29, 155, 240, 0.2);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* Custom Input Fields */
.form-group input[type="text"].hidden {
  margin-top: 10px;
}

.form-group input[type="text"]:not(.hidden) {
  margin-top: 10px;
  animation: fadeIn 0.3s ease-in;
}

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

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--panel-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  transition: var(--transition);
  text-decoration: none;
}

.btn:hover {
  background-color: rgba(29, 155, 240, 0.1);
  border-color: #217dbb;
  transform: translateY(-1px);
  color: white;
}

.btn.primary {
  border-color: var(--primary-color);
  color: white;
}

.btn.primary:hover {
  background-color: rgba(29, 155, 240, 0.1);
  border-color: #217dbb;
  color: white;
}

.btn.secondary {
  border-color: var(--secondary-color);
  color: white;
}

.btn.secondary:hover {
  background-color: rgba(0, 186, 124, 0.1);
  border-color: #27ae60;
  color: white;
}

.btn.small {
  padding: 6px 12px;
  font-size: 12px;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: transparent;
}

.btn[disabled]:hover {
  background-color: transparent;
  transform: none;
}

.button-group {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.button-group .btn {
  flex: 0 0 auto;
  min-width: 120px;
}

/* Generator Panel */
/* NOTE: the main "back" container should be fully transparent so the site background shows through.
   Child columns (.options-panel, .preview-panel, etc.) remain as semi-transparent glass. */
.generator-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 40px;

  /* Make the far-back container fully transparent so background image is clearly visible */
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid transparent !important;
  border-radius: var(--border-radius);
  padding: 18px;
  box-shadow: none !important;
}

/* Child columns should remain semi-transparent glass so content still reads on top of the background */
.generator-panel > .options-panel,
.generator-panel > .preview-panel,
.generator-panel > .upload-section {
  background: linear-gradient(rgba(20,20,20,0.45), rgba(20,20,20,0.45)) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--box-shadow) !important;
  padding: 20px !important;
}

/* Chat Panel Styles */
.chat-panel {
  grid-column: 1 / -1;
  background-color: var(--panel-bg);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--box-shadow);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.chat-header h3 {
  margin: 0;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-header h3 i {
  color: var(--primary-color);
}

.chat-container {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background-color: var(--input-bg);
  overflow: hidden;
}

.chat-messages {
  height: 300px;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: fadeInUp 0.3s ease-out;
}

.message.user-message {
  flex-direction: row-reverse;
}

.message-content {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 80%;
}

.user-message .message-content {
  flex-direction: row-reverse;
}

.message-content i {
  font-size: 20px;
  margin-top: 2px;
  flex-shrink: 0;
}

.ai-message .message-content i {
  color: var(--primary-color);
}

.user-message .message-content i {
  color: var(--secondary-color);
}

.message-text {
  background-color: var(--panel-bg);
  padding: 12px 16px;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  line-height: 1.5;
}

.user-message .message-text {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.message-text p {
  margin: 0 0 8px 0;
}

.message-text p:last-child {
  margin-bottom: 0;
}

.message-text em {
  color: var(--primary-color);
  font-style: italic;
}

.user-message .message-text em {
  color: rgba(255, 255, 255, 0.8);
}

.parameter-update {
  background-color: rgba(29, 155, 240, 0.1);
  border: 1px solid rgba(29, 155, 240, 0.3);
  border-radius: var(--border-radius);
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 14px;
  color: var(--primary-color);
}

.parameter-update i {
  margin-right: 6px;
}

.chat-input-container {
  border-top: 1px solid var(--border-color);
  padding: 15px;
  background-color: var(--panel-bg);
}

.chat-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
}

#chatInput {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background-color: var(--input-bg);
  color: var(--text-color);
  font-size: 16px;
  resize: none;
  transition: var(--transition);
}

#chatInput:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 2px rgba(29, 155, 240, 0.2);
}

#sendChatBtn {
  padding: 12px 16px;
  min-width: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#sendChatBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-status {
  margin-top: 8px;
  font-size: 14px;
  color: #71767b;
  min-height: 20px;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-color);
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background-color: var(--primary-color);
  border-radius: 50%;
  animation: typingDots 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingDots {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

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

/* Panel Header Styles */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.panel-header h2 {
  margin: 0;
}

.mode-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mode-badge {
  padding: 6px 12px;
  border-radius: var(--border-radius);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mode-badge.form-mode {
  background-color: rgba(0, 186, 124, 0.1);
  color: var(--secondary-color);
  border: 1px solid rgba(0, 186, 124, 0.3);
}

.mode-badge.chat-mode {
  background-color: rgba(29, 155, 240, 0.1);
  color: var(--primary-color);
  border: 1px solid rgba(29, 155, 240, 0.3);
}

/* Form field highlighting for chat mode */
.form-group.updated {
  animation: highlightUpdate 0.5s ease-out;
}

@keyframes highlightUpdate {
  0% { background-color: rgba(29, 155, 240, 0.2); }
  100% { background-color: transparent; }
}

.form-control.updated {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(29, 155, 240, 0.2);
  animation: fieldUpdate 0.5s ease-out;
}

@keyframes fieldUpdate {
  0% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.options-panel, .preview-panel {
  background-color: rgba(30, 30, 30, 0.6);
  border-radius: var(--border-radius);
  padding: 25px;
  box-shadow: var(--box-shadow);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.preview-panel textarea {
  width: 100%;
  min-height: 150px;
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-family: monospace;
  font-size: 14px;
  line-height: 1.5;
  background-color: var(--input-bg);
  color: var(--text-color);
}

/* Image Preview */
.image-preview {
  position: relative;
  min-height: 300px;
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius);
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--input-bg);
}

/* Placeholder Message */
.placeholder-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #71767b;
  text-align: center;
  padding: 40px 20px;
}

.placeholder-message i {
  font-size: 48px;
  margin-bottom: 15px;
  opacity: 0.5;
}

.placeholder-message p {
  font-size: 16px;
  margin: 0;
}

.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  min-height: 200px;
  width: 100%;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 15px;
}

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

.image-container {
  width: 100%;
}

.image-container img {
  max-width: 100%;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.image-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 15px;
}

.hidden {
  display: none;
}

/* Embroidery-specific styles */
.form-help {
  font-size: 12px;
  color: #71767b;
  margin-top: 5px;
  font-style: italic;
}

.embroidery-info {
  background-color: var(--panel-bg);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-top: 30px;
  border-left: 4px solid var(--secondary-color);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.embroidery-info h3 {
  color: var(--secondary-color);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.embroidery-info ul {
  margin: 0;
  padding-left: 20px;
}

.embroidery-info li {
  margin-bottom: 8px;
  color: var(--text-color);
}

.embroidery-tips {
  background-color: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: var(--border-radius);
  padding: 15px;
  margin-top: 15px;
}

.embroidery-tips h4 {
  color: #ffc107;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.embroidery-tips p {
  color: #e7e9ea;
  margin: 0;
  font-size: 14px;
}

/* Character Consistency Styles */
.character-consistency-options {
  margin-top: 12px;
  padding: 15px;
  background-color: var(--input-bg);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.form-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 0;
}

.checkbox-label i {
  color: var(--primary-color);
  font-size: 16px;
}

.saved-character-info {
  padding: 10px 12px;
  background-color: rgba(29, 155, 240, 0.1);
  border: 1px solid rgba(29, 155, 240, 0.3);
  border-radius: var(--border-radius);
  font-size: 14px;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.saved-character-info i {
  color: var(--primary-color);
  font-size: 14px;
}

.saved-character-info.warning {
  background-color: rgba(255, 193, 7, 0.1);
  border-color: rgba(255, 193, 7, 0.3);
  color: #ffc107;
}

.saved-character-info.warning i {
  color: #ffc107;
}

.character-locked {
  background-color: var(--input-bg) !important;
  color: #71767b !important;
  cursor: not-allowed !important;
}

/* History Page */
.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.history-card {
  background-color: var(--panel-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.history-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(255, 255, 255, 0.05);
}

.history-image {
  height: 200px;
  overflow: hidden;
}

.history-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.history-card:hover .history-image img {
  transform: scale(1.05);
}

.history-details {
  padding: 20px;
}

.history-timestamp {
  font-size: 14px;
  color: #71767b;
  margin-bottom: 15px;
}

.history-parameters p {
  margin-bottom: 5px;
  font-size: 14px;
  color: var(--text-color);
}

.history-prompt {
  margin: 15px 0;
}

.history-prompt summary {
  cursor: pointer;
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 10px;
}

.prompt-text {
  background-color: var(--input-bg);
  padding: 10px;
  border-radius: var(--border-radius);
  font-family: monospace;
  font-size: 12px;
  white-space: pre-wrap;
  margin-top: 10px;
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.history-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  background-color: var(--panel-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border: 1px solid var(--border-color);
}

.empty-icon {
  font-size: 60px;
  color: #71767b;
  margin-bottom: 20px;
}

.empty-state h3 {
  margin-bottom: 10px;
  color: var(--text-color);
}

.empty-state p {
  margin-bottom: 25px;
  color: #71767b;
}

/* About Page */
.about-section {
  background-color: var(--panel-bg);
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--box-shadow);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.about-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  margin: 30px 0;
}

.about-text h3 {
  margin-top: 25px;
  margin-bottom: 15px;
  color: var(--text-color);
}

.about-text p {
  margin-bottom: 15px;
  color: var(--text-color);
}

.about-text ul, .about-text ol {
  margin-left: 20px;
  margin-bottom: 20px;
}

.about-text li {
  margin-bottom: 8px;
  color: var(--text-color);
}

.about-image img {
  width: 100%;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.image-caption {
  text-align: center;
  margin-top: 10px;
  font-style: italic;
  color: #71767b;
}

.tech-stack {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--border-color);
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  list-style: none;
  margin-top: 15px;
}

.tech-list li {
  background-color: var(--input-bg);
  padding: 10px 15px;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.tech-list li i {
  color: var(--primary-color);
}

/* Footer */
footer {
  background-color: var(--dark-color);
  color: white;
  padding: 20px 0;
  margin-top: 50px;
  text-align: center;
  border-top: 1px solid var(--border-color);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.footer-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.footer-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  padding: 8px 12px;
  border-radius: var(--border-radius);
}

.footer-link:hover {
  color: var(--primary-color);
  background-color: rgba(255, 255, 255, 0.05);
}

footer p {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

/* Parameter Presets Styles */
.preset-selector {
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
}

.preset-selector h3 {
  margin-bottom: 15px;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.preset-selector h3 i {
  color: var(--primary-color);
}

.preset-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 15px;
}

.preset-btn {
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background-color: var(--input-bg);
  color: var(--text-color);
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  white-space: nowrap;
}

.preset-btn:hover {
  border-color: var(--primary-color);
  background-color: rgba(29, 155, 240, 0.1);
  color: var(--primary-color);
}

.preset-btn.active {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.preset-info {
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 12px;
  font-size: 14px;
  color: #71767b;
  margin-top: 10px;
}

.preset-applied {
  background-color: rgba(0, 186, 124, 0.1);
  border: 1px solid rgba(0, 186, 124, 0.3);
  border-radius: var(--border-radius);
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 14px;
  color: var(--secondary-color);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeInUp 0.3s ease-out;
}

.preset-applied i {
  color: var(--secondary-color);
}

/* Progress Tracking Styles */
.detailed-progress {
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 20px;
  margin: 20px 0;
  display: none;
}

.detailed-progress.active {
  display: block;
  animation: fadeInUp 0.3s ease-out;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.progress-header h3 {
  margin: 0;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-header h3 i {
  color: var(--primary-color);
}

.progress-stats {
  display: flex;
  gap: 20px;
  font-size: 14px;
  color: #71767b;
}

.progress-stages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.stage {
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 15px;
  text-align: center;
  transition: var(--transition);
}

.stage.active {
  border-color: var(--primary-color);
  background-color: rgba(29, 155, 240, 0.1);
}

.stage.completed {
  border-color: var(--secondary-color);
  background-color: rgba(0, 186, 124, 0.1);
}

.stage-icon {
  font-size: 24px;
  margin-bottom: 10px;
  color: #71767b;
}

.stage.active .stage-icon {
  color: var(--primary-color);
  animation: pulse 2s infinite;
}

.stage.completed .stage-icon {
  color: var(--secondary-color);
}

.stage-title {
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text-color);
}

.stage-description {
  font-size: 12px;
  color: #71767b;
  margin-bottom: 10px;
}

.stage-progress {
  width: 100%;
  height: 6px;
  background-color: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
}

.stage-progress-bar {
  height: 100%;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
  width: 0%;
}

.stage.completed .stage-progress-bar {
  background-color: var(--secondary-color);
  width: 100%;
}

.overall-progress {
  margin-top: 20px;
}

.overall-progress-bar {
  width: 100%;
  height: 8px;
  background-color: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.overall-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-color);
}

.cancel-btn {
  background-color: var(--accent-color);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
}

.cancel-btn:hover {
  background-color: #d91656;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Error Handling Styles */
.error-container {
  background-color: var(--panel-bg);
  border: 1px solid var(--accent-color);
  border-radius: var(--border-radius);
  padding: 20px;
  margin: 20px 0;
  display: none;
}

.error-container.active {
  display: block;
  animation: fadeInUp 0.3s ease-out;
}

.error-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.error-header i {
  color: var(--accent-color);
  font-size: 20px;
}

.error-header h3 {
  margin: 0;
  color: var(--accent-color);
}

.error-card {
  background-color: rgba(249, 24, 128, 0.1);
  border: 1px solid rgba(249, 24, 128, 0.3);
  border-radius: var(--border-radius);
  padding: 15px;
  margin-bottom: 15px;
}

.error-message {
  color: var(--text-color);
  margin-bottom: 10px;
  font-weight: 500;
}

.error-details {
  font-size: 14px;
  color: #71767b;
  margin-bottom: 15px;
  font-family: monospace;
  background-color: var(--input-bg);
  padding: 10px;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.error-suggestions {
  margin-top: 15px;
}

.error-suggestions h4 {
  color: var(--text-color);
  margin-bottom: 10px;
  font-size: 16px;
}

.error-suggestions ul {
  margin: 0;
  padding-left: 20px;
}

.error-suggestions li {
  color: var(--text-color);
  margin-bottom: 5px;
  font-size: 14px;
}

.retry-section {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.retry-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.retry-btn:hover {
  background-color: #217dbb;
}

.retry-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.retry-status {
  font-size: 14px;
  color: #71767b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.retry-status i {
  color: var(--primary-color);
}

.dismiss-btn {
  background-color: transparent;
  color: #71767b;
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
  margin-left: auto;
}

.dismiss-btn:hover {
  background-color: var(--hover-color);
  color: var(--text-color);
}

/* Three.js Viewer Enhancements */
.threejs-container {
  position: relative;
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.threejs-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  color: var(--text-color);
  z-index: 10;
}

.threejs-loading .spinner {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

.threejs-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--accent-color);
  z-index: 10;
  padding: 20px;
}

.threejs-error i {
  font-size: 48px;
  margin-bottom: 15px;
  opacity: 0.7;
}

.threejs-error p {
  margin: 0;
  font-size: 16px;
}

.viewer-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
  z-index: 20;
}

.viewer-control-btn {
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 12px;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.viewer-control-btn:hover {
  background-color: rgba(29, 155, 240, 0.8);
}

.viewer-control-btn.active {
  background-color: var(--primary-color);
}

.viewer-info {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 12px;
  border-radius: var(--border-radius);
  font-size: 12px;
  backdrop-filter: blur(10px);
  z-index: 20;
}

/* Forge Page Styles */
.image-preview-container {
  margin-top: 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 15px;
  background-color: var(--input-bg);
}

.image-canvas-wrapper {
  position: relative;
  display: inline-block;
  border-radius: var(--border-radius);
  overflow: hidden;
  background-color: var(--input-bg);
}

.image-preview {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--border-radius);
}

.mask-canvas-overlay {
  position: absolute;
  top: 0;
  left: 0;
  cursor: crosshair;
  background: transparent;
  pointer-events: auto;
  z-index: 10;
}

.mask-canvas-overlay:hover {
  cursor: crosshair;
}

.mask-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.mask-controls .btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.brush-size-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.brush-size-control input[type="range"] {
  flex: 1;
  max-width: 200px;
}

.brush-size-control span {
  min-width: 50px;
  font-weight: 500;
  color: var(--text-color);
}

.drawing-color-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
}

.drawing-color-control label {
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 5px;
}

.drawing-color-control select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background-color: var(--input-bg);
  color: var(--text-color);
  font-size: 14px;
}

.drawing-color-control select:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 2px rgba(29, 155, 240, 0.2);
}

.canvas-container {
  position: relative;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  background-color: var(--input-bg);
}

.mask-canvas {
  display: block;
  cursor: crosshair;
  background: transparent;
}

.mask-canvas:hover {
  cursor: crosshair;
}

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

.generated-image-item {
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 15px;
  text-align: center;
}

.generated-image-item img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  margin-bottom: 10px;
  box-shadow: var(--box-shadow);
}

/* Compact Controls Styles */
.controls-compact {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.control-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.control-group-compact {
  background: var(--panel-bg);
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.control-label-compact {
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.control-input-compact {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  background: var(--input-bg);
  color: var(--text-color);
}

.control-input-compact:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(29, 155, 240, 0.2);
}

.range-group-compact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.range-group-compact input[type="range"] {
  flex: 1;
  padding: 0;
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

.range-group-compact input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: 2px solid var(--panel-bg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.range-group-compact input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: 2px solid var(--panel-bg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.range-value-compact {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 0.875rem;
  min-width: 2.5rem;
  text-align: center;
  background: var(--input-bg);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

/* Responsive Design */
@media (max-width: 768px) {
  .generator-panel {
    grid-template-columns: 1fr;
  }
  
  .about-content {
    grid-template-columns: 1fr;
  }
  
  .history-grid {
    grid-template-columns: 1fr;
  }
  
  .preset-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .progress-stages {
    grid-template-columns: 1fr;
  }
  
  .progress-stats {
    flex-direction: column;
    gap: 10px;
  }
  
  .retry-section {
    flex-direction: column;
    align-items: stretch;
  }
  
  .viewer-controls {
    position: relative;
    top: auto;
    right: auto;
    justify-content: center;
    margin: 10px 0;
  }
  
  .viewer-info {
    position: relative;
    bottom: auto;
    left: auto;
    text-align: center;
    margin: 10px 0;
  }
  
  .generated-images-grid {
    grid-template-columns: 1fr;
  }
  
  .mask-controls {
    justify-content: center;
  }
  
  .brush-size-control {
    justify-content: center;
  }
  
  .control-row {
    grid-template-columns: 1fr;
  }
  
  .controls-compact {
    gap: 0.75rem;
  }
  
  .control-group-compact {
    padding: 0.75rem;
  }
}

/* Final high-priority overrides to force glass panels for remaining pages/elements,
   including 3D Generator, Relief Generator, Depth Map and any inline-styled buttons/pills.
   These use high specificity + !important to override per-page inline styles. */

/* Extra fixes for 3D Generator / Relief / Depth Map pages
   - Force any inline dark wrapper (common in these pages) to be fully transparent (so background shows through)
   - Keep the interactive child panels (controls, upload drop area, cards) as semi-transparent glass
   - Catch common inline patterns used in templates (rgba(0,0,0,0.7), rgba(30,30,30,0.6), var(--card-bg), var(--input-bg))
*/
html body [style*="background: rgba(0, 0, 0, 0.7)"],
html body [style*="background: rgba(0,0,0,0.7)"],
html body [style*="background: var(--card-bg)"],
html body [style*="background: var(--input-bg)"] {
  /* make wrapper-level elements transparent so the shared site background shows through */
  background: transparent !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--text-color) !important;
}

/* rgba(30,30,30,0.6) is used by glass panels — do NOT make transparent */

/* Ensure the upload/drop area and large control panels remain readable as glass cards */
html body .upload-section,
html body .upload-section[style],
html body .image-preview,
html body .image-preview[style],
html body .generate-preview,
html body .generate-preview[style],
html body .control-group,
html body .control-group[style],
html body .quality-selector,
html body .background-info,
html body .popup-dialog {
  background: linear-gradient(rgba(20,20,20,0.45), rgba(20,20,20,0.45)) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--border-radius) !important;
  box-shadow: var(--box-shadow) !important;
  color: var(--text-color) !important;
}

/* Explicitly override any inline rgba dark fills used for full-width panels on these pages */
html body [style*="background: rgba(0, 0, 0, 0.7)"] > .upload-section,
html body [style*="background: rgba(0, 0, 0, 0.7)"] .image-preview,
html body [style*="background: rgba(0, 0, 0, 0.7)"] .control-group {
  background: linear-gradient(rgba(20,20,20,0.45), rgba(20,20,20,0.45)) !important;
  backdrop-filter: blur(10px) !important;
}

/* Keep header/title rows (section headers) transparent when they are wrapper-level */
html body .section-header,
html body .section-top,
html body .panel-top,
html body .panel-header[style] {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Site-wide: make the deepest page wrapper fully transparent so the site background
   shows through behind all content. Keep all cards/panels/buttons semi-transparent glass. */
html body main,
html body main .container,
html body .page-wrapper,
html body .content-wrapper,
html body .main-content,
html body .container > * {
  background: transparent !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--text-color) !important;
}
html body header, 
html body header .container,
html body .header-nav *[class*="nav"],
html body .header-nav *[class*="button"],
html body .header-nav [style],
html body .header-nav .nav-link,
html body .header-nav .nav-link[style],
html body .btn,
html body .btn[style],
html body [style*="background: var(--card-bg)"],
html body [style*="background: var(--input-bg)"],
html body [style*="background: var(--panel-bg)"],
html body .quality-selector[style],
html body .control-group[style],
html body .background-info[style],
html body .tools-grid[style] {
  background: linear-gradient(rgba(20,20,20,0.45), rgba(20,20,20,0.45)) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--border-radius) !important;
  color: var(--text-color) !important;
}

/* Make active nav-pill semi-transparent instead of solid */
.header-nav .nav-link.active,
.header-nav .nav-link.active[style] {
  background: linear-gradient(135deg, rgba(29,155,240,0.22), rgba(0,186,124,0.16)) !important;
  color: var(--text-color) !important;
  border-color: var(--primary-color) !important;
}

/* Ensure buttons keep accent borders but remain glass */
.btn-primary, .btn-primary[style] {
  background: linear-gradient(rgba(20,20,20,0.45), rgba(20,20,20,0.45)) !important;
  border: 1px solid var(--primary-color) !important;
  color: var(--text-color) !important;
}

.btn-secondary, .btn-secondary[style] {
  background: linear-gradient(rgba(20,20,20,0.45), rgba(20,20,20,0.45)) !important;
  border: 1px solid var(--secondary-color) !important;
  color: var(--text-color) !important;
}

/* Force tool-card and card-bg inline styled blocks to be glass */
.tool-card[style],
.card[style],
.control-group[style],
.background-info[style] {
  background: linear-gradient(rgba(20,20,20,0.45), rgba(20,20,20,0.45)) !important;
  backdrop-filter: blur(12px) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-color) !important;
}

/* HIGH-PRIORITY: Force header container to be fully transparent site-wide and ensure
   the header navigation pills/buttons render as semi-transparent glass regardless of inline styles. */

/* Specific fixes for relief/3d/depth pages that use different wrapper classes:
   - Make the page-level wrappers fully transparent (so the site background shows through)
   - Keep immediate content panels, upload/drop areas and control-groups as semi-transparent glass
*/
.generator-panel-single,
.generator-panel-single[style],
.options-panel-single,
.options-panel-single[style],
.panel-header,
.panel-header[style] {
  background: transparent !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  color: var(--text-color) !important;
}

/* Make child panels inside those pages glass so content remains readable */
.generator-panel-single > .options-panel-single,
.generator-panel-single .control-group,
.generator-panel-single .upload-zone,
.generator-panel-single .generate-preview,
.generator-panel-single .image-preview,
.generator-panel-single .control-group[style],
.generator-panel-single .background-info,
.generator-panel-single .popup-dialog,
.options-panel-single .control-group {
  background: linear-gradient(rgba(20,20,20,0.45), rgba(20,20,20,0.45)) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--border-radius) !important;
  box-shadow: var(--box-shadow) !important;
  padding: 20px !important;
}

/* Some templates use inline background on immediate wrapper; if so, force their children to be glass */
html body [style*="background: rgba(30, 30, 30, 0.6)"] .upload-zone,
html body [style*="background: rgba(30, 30, 30, 0.6)"] .control-group,
html body [style*="background: rgba(30, 30, 30, 0.6)"] .generate-preview {
  background: linear-gradient(rgba(20,20,20,0.45), rgba(20,20,20,0.45)) !important;
  backdrop-filter: blur(10px) !important;
}

/* Keep section headers/panel headers transparent if they're wrapper-level */
html body .panel-header,
html body .panel-header[style],
html body .section-top,
html body .section-header {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
html body header,
html body header[style],
html body .header,
html body .header[style],
html body header .container,
html body header .container[style],
html body .page-header,
html body .page-header[style] {
  background: transparent !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--text-color) !important;
}

/* Force nav pills/buttons in header to glass even if inline-styled on template files */

/* Container: make header nav itself fully transparent so only the pills/buttons are glass */
html body .header-nav,
html body .header-nav[style],
html body header .nav-wrapper,
html body .header-nav > div {
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* Individual nav pills / buttons remain semi-transparent glass */
html body .header-nav .nav-link,
html body .header-nav .nav-link[style],
html body .header-nav .nav-link i,
html body .header-nav .nav-link span,
html body .header-nav .nav-link .badge,
html body header .nav-link,
html body .nav-link[style],
html body .auth-menu .nav-link[style],
html body .header-nav .button-group,
html body .header-nav .button-group[style],
html body .btn[style] {
  background: linear-gradient(rgba(20,20,20,0.45), rgba(20,20,20,0.45)) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--border-radius) !important;
  color: var(--text-color) !important;
  box-shadow: var(--box-shadow) !important;
}

/* Active/primary nav pill should keep accent border but remain glass */
html body .header-nav .nav-link.active,
html body .header-nav .nav-link.active[style] {
  background: linear-gradient(135deg, rgba(29,155,240,0.18), rgba(0,186,124,0.12)) !important;
  color: var(--text-color) !important;
  border-color: var(--primary-color) !important;
}

/* Ensure small icon badges or user-info in header are glass too */
html body .user-info,
html body .user-info[style],
html body .auth-menu,
html body .auth-menu[style] {
  background: linear-gradient(rgba(20,20,20,0.45), rgba(20,20,20,0.45)) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(29,29,29,0.25) !important;
  color: var(--text-color) !important;
}

/* ── Pipeline pages: adv-settings-wrap must stay glass, not transparent ── */
html body .adv-settings-wrap,
html body .adv-settings-wrap[style],
html body .pipe-main .adv-settings-wrap,
html body .cf-right .adv-settings-wrap {
  background: rgba(30,30,30,0.6) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255,255,255,0.18) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* ── Pipeline pages: adv-settings-wrap needs side padding on its inner content ── */
html body .adv-settings-wrap .adv-section-body,
html body .adv-settings-wrap .adv-part .adv-section-body {
  padding: 1rem 1.5rem 1.5rem !important;
}

/* ── Pipeline pages: pipe-main needs horizontal padding so content doesn't touch edges ── */
html body .pipe-main {
  padding-left: 1.5rem !important;
  padding-right: 1.5rem !important;
}

/* ── Pipeline pages: adv-settings-wrap section toggle needs left padding ── */
html body .adv-settings-wrap .adv-section-toggle {
  padding-left: 1.1rem !important;
  padding-right: 1.1rem !important;
}

/* About page glass panel — override the global transparent rule */
html body .about-container {
  background: rgba(20, 22, 28, 0.72) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.55) !important;
}

/* ========================================================================
   OXI STUDIOS VISUAL REFRESH — shared foundation
   ======================================================================== */
:root {
  --primary-color: #78bdf7;
  --primary-light: rgba(120, 189, 247, 0.08);
  --secondary-color: #cbd5e1;
  --accent-color: #aeb8c5;
  --dark-color: #07090c;
  --light-color: #11151b;
  --text-color: #f4f7fb;
  --text-primary: #f4f7fb;
  --text-muted: #929ba8;
  --border-color: rgba(255, 255, 255, 0.11);
  --hover-color: #171c24;
  --hover-bg: rgba(255, 255, 255, 0.055);
  --input-bg: rgba(13, 17, 23, 0.88);
  --panel-bg: rgba(15, 19, 25, 0.78);
  --card-bg: rgba(15, 19, 25, 0.78);
  --border-radius: 13px;
  --box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
  --transition: 160ms ease;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.008em;
  background: #07090c;
}

body:not(.landing-page)::after {
  background:
    radial-gradient(circle at 18% 0%, rgba(75, 126, 173, 0.05), transparent 36%),
    linear-gradient(180deg, rgba(4, 6, 9, 0.83), rgba(4, 6, 9, 0.93));
}

.container {
  max-width: 1280px;
  padding-inline: clamp(16px, 3vw, 32px);
}

header {
  padding: 18px 0 16px;
  margin-bottom: 24px;
}

.header-logo {
  gap: 12px;
  margin-bottom: 6px;
}

.header-logo .logo {
  width: 42px;
  height: 42px;
}

header h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2.2vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

header p {
  max-width: 720px;
  margin: 6px 0 14px;
  color: var(--text-muted);
  font-size: 0.94rem;
}

h1, h2, h3, h4 {
  letter-spacing: -0.025em;
}

p {
  text-wrap: pretty;
}

input,
textarea,
select,
.form-control {
  border-radius: 10px !important;
  border-color: rgba(255, 255, 255, 0.13) !important;
  background: rgba(7, 10, 14, 0.78) !important;
}

input:focus,
textarea:focus,
select:focus,
.form-control:focus {
  border-color: rgba(82, 168, 255, 0.72) !important;
  box-shadow: 0 0 0 3px rgba(82, 168, 255, 0.14) !important;
}

html body .btn,
html body .btn[style] {
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 10px !important;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: none !important;
}

html body .btn.primary,
html body .btn-primary,
html body .btn-primary[style] {
  border-color: rgba(112, 187, 251, 0.62) !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012)) !important;
  color: #f5f9fd !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    0 10px 28px rgba(0, 0, 0, 0.18) !important;
  backdrop-filter: blur(14px) saturate(125%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(125%) !important;
}

html body .btn.primary:hover,
html body .btn-primary:hover {
  border-color: rgba(139, 205, 255, 0.9) !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(112, 187, 251, 0.025)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 0 0 1px rgba(112, 187, 251, 0.08),
    0 13px 32px rgba(0, 0, 0, 0.24) !important;
  transform: translateY(-1px) !important;
}

html body .btn.secondary,
html body .btn-secondary,
html body .btn-secondary[style] {
  border-color: rgba(255, 255, 255, 0.2) !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)) !important;
  color: #edf3fa !important;
}

html body .btn.secondary:hover,
html body .btn-secondary:hover {
  border-color: rgba(112, 187, 251, 0.62) !important;
  background: rgba(255, 255, 255, 0.035) !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #69b4ff !important;
  outline-offset: 3px;
}

main [class*="panel"],
main [class*="card"],
main .upload-section,
main .tool-card,
main .empty-state {
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18) !important;
}

@media (max-width: 768px) {
  .container { padding-inline: 16px; }
  header { padding-top: 14px; margin-bottom: 16px; }
  .header-logo .logo { width: 36px; height: 36px; }
  header p { max-width: calc(100% - 64px); font-size: 0.82rem; }
  .generator-panel { padding: 0 !important; gap: 16px; }
}

/* Shared neutral glass surfaces. Explicit classes avoid tinting card contents,
   image canvases, status messages or navigation popovers. Keep this after the
   legacy glass rules so page-specific palettes use one consistent surface. */
:root {
  --glass-card-bg: rgba(18, 22, 28, 0.42);
  --glass-card-shine: linear-gradient(135deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.008));
  --card-bg: var(--glass-card-bg);
  --panel-bg: var(--glass-card-bg);
}

html body :is(
  .start-grid > a, .home-tool-directory, .feature-card, .tool-card, .card,
  .use-case, .membership-plan, .membership-note, .hero-workflow,
  .box-factory-showcase, .studio-tools, .cta-section,
  .product-card, .prompt-card, .news-card, .topic-card, .faq-contact-card,
  .step-card, .summary-card, .upgrade-card, .result-card, .template-card,
  .ba-card, .ei-gen-card, .emb-stat-card, .fonts-panel, .options-panel,
  .options-panel-single, .current-file-panel, .auth-container,
  .about-container, .contact-container, .legal-container, .how-to-container,
  .cancel-container, .success-container, .delete-container,
  .ei-panel, .ei-gen-panel, .gf-params-panel, .emb-panel-left,
  .emb-panel-right, .emb-panel-section, .panel-left, .panel-right,
  .border-card, .font-card, .tag-shape-card, .wt-font-card,
  .ei-model-card, .ei-quality-card, .ei-size-card
) {
  background: var(--glass-card-shine), var(--glass-card-bg) !important;
  -webkit-backdrop-filter: blur(12px) saturate(115%) !important;
  backdrop-filter: blur(12px) saturate(115%) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 32px rgba(0, 0, 0, 0.16) !important;
}

/* Let the background show behind both pricing cards, without stacking glass. */
html body.landing-page .membership-section {
  background: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

html body .start-grid > a:hover {
  border-color: rgba(190, 210, 232, 0.65);
}

/* Preserve readability when the visitor requests reduced transparency. */
@media (prefers-reduced-transparency: reduce) {
  :root { --glass-card-bg: rgba(18, 22, 28, 0.96); }
}
