/* ============================================================================
   INDEX.CSS - Styles for the Think In Cycles homepage (index.html)
   ============================================================================ */

/* ============================================================================
   COLOR PALETTE - Change these to update colors site-wide
   ============================================================================ */
:root {
  /* Primary brand color - used for key buttons, accents */
  --color-primary: #007FFF;
  --color-primary-hover: #0066CC;

  /* Text colors */
  --color-text-primary: #0d0d0d;
  --color-text-secondary: #666666;
  --color-text-muted: #999999;
  --color-text-inverse: #ffffff;

  /* Background colors */
  --color-bg-primary: #ffffff;
  --color-bg-secondary: #f4f4f4;
  --color-bg-hover: #f0f0f0;
  --color-bg-input: #f4f4f4;

  /* Border colors */
  --color-border: #e5e5e5;
  --color-border-light: #eeeeee;

  /* Shadow */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);

  /* Border radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* Font */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
}

/* Define custom property for animatable border angle */
@property --border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes border-spin {
  to {
    --border-angle: 360deg;
  }
}

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

body {
  font-family: var(--font-family);
  font-weight: var(--font-weight-light);
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 50%, #f1f3f5 100%);
  color: var(--color-text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================================
   DEV ENVIRONMENT INDICATOR
   ============================================================================ */
.dev-env-banner {
  display: none;
  width: 100%;
  background: #ff6b35;
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 0;
  text-align: center;
  letter-spacing: 0.3px;
}

body.is-dev-env .dev-env-banner {
  display: block;
}

/* ============================================================================
   AUTH LOADING STATE - Hide UI until auth state is determined
   ============================================================================ */
body.auth-loading nav,
body.auth-loading .auth-buttons,
body.auth-loading main,
body.auth-loading footer,
body.auth-loading .cookie-banner,
body.auth-processing-email nav,
body.auth-processing-email .auth-buttons,
body.auth-processing-email main,
body.auth-processing-email footer,
body.auth-processing-email .cookie-banner {
  opacity: 0;
  pointer-events: none;
}

/* Auth Loading Overlay with Spinner */
.auth-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Show spinner during auth loading and email sign-in processing */
body.auth-loading .auth-loading-overlay,
body.auth-processing-email .auth-loading-overlay {
  opacity: 1;
  pointer-events: auto;
}

.auth-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(37, 99, 235, 0.2);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.auth-loading-text {
  margin-top: 16px;
  color: #666;
  font-size: 14px;
  font-weight: 500;
}

/* Smooth fade-in when auth state is ready (but not during sign-in processing) */
body.auth-ready:not(.auth-processing-email) nav,
body.auth-ready:not(.auth-processing-email) .auth-buttons,
body.auth-ready:not(.auth-processing-email) main,
body.auth-ready:not(.auth-processing-email) footer {
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Auth state classes for conditional UI */
.show-anonymous { display: none !important; }
body.auth-anonymous .show-anonymous { display: flex !important; }

.show-logged-in { display: none !important; }
body.auth-logged-in .show-logged-in { display: flex !important; }

.show-subscribed { display: none !important; }
body.auth-subscribed .show-subscribed { display: flex !important; }
body.auth-subscribed .show-subscribed.dynamic-tagline { display: block !important; }

.hide-when-logged-in { }
body.auth-logged-in .hide-when-logged-in,
body.auth-subscribed .hide-when-logged-in { display: none !important; }

/* Hide header background when logged in */
body.auth-logged-in header,
body.auth-subscribed header {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
  box-shadow: none;
}

/* ============================================================================
   SIDEBAR - For logged-in users
   ============================================================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-right: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.05),
              inset -1px 0 0 rgba(255, 255, 255, 0.6);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform 0.3s ease, width 0.3s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  height: 53px;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo-icon {
  width: 28px;
  height: 28px;
}

.sidebar-logo-icon img {
  width: 100%;
  height: 100%;
}

.sidebar-logo-text {
  font-size: 15px;
  font-weight: var(--font-weight-normal);
  color: var(--color-text-primary);
}

.sidebar-toggle-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.sidebar-toggle-btn:hover {
  background-color: var(--color-bg-hover);
}

.sidebar-toggle-btn img {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

.sidebar-actions {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  font-size: 14px;
  font-weight: var(--font-weight-normal);
  color: var(--color-text-primary);
  transition: background-color 0.2s;
  width: 100%;
  text-align: left;
}

.sidebar-action-btn:hover {
  background-color: var(--color-bg-hover);
}

.sidebar-action-btn img {
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 16px;
}

.sidebar-section {
  margin-bottom: 8px;
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
  cursor: pointer;
  user-select: none;
}

.sidebar-section-title {
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-section-toggle {
  width: 10px;
  height: 10px;
  opacity: 0.4;
  transition: transform 0.2s;
}

.sidebar-section.collapsed .sidebar-section-toggle {
  transform: rotate(-90deg);
}

.sidebar-section-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-section.collapsed .sidebar-section-content {
  display: none;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--color-text-primary);
  cursor: pointer;
  transition: background-color 0.2s;
  text-decoration: none;
}

.sidebar-item:hover {
  background-color: var(--color-bg-hover);
}

.sidebar-item img {
  width: 16px;
  height: 16px;
  opacity: 0.6;
}

.sidebar-item-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--color-border-light);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.sidebar-user:hover {
  background-color: var(--color-bg-hover);
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
}

.sidebar-user-email {
  flex: 1;
  font-size: 13px;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Collapsed sidebar state */
.sidebar.collapsed {
  width: 56px;
  cursor: e-resize;
}

/* Keep pointer cursor on interactive elements within collapsed sidebar */
.sidebar.collapsed .sidebar-logo-icon,
.sidebar.collapsed .sidebar-action-btn,
.sidebar.collapsed .sidebar-user {
  cursor: pointer;
}

.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .sidebar-action-btn span,
.sidebar.collapsed .sidebar-section,
.sidebar.collapsed .sidebar-user-email {
  display: none;
}

.sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 12px;
}

.sidebar.collapsed .sidebar-logo {
  display: flex;
}

.sidebar.collapsed .sidebar-logo-text {
  display: none;
}

.sidebar.collapsed .sidebar-toggle-btn {
  display: none;
}

/* When collapsed, show logo that transforms to sidebar icon on hover */
.sidebar.collapsed .sidebar-logo-icon {
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background-color 0.2s;
  width: 28px;
  height: 28px;
}

.sidebar.collapsed .sidebar-logo-icon:hover {
  background-color: var(--color-bg-hover);
}

/* Replace logo with sidebar open icon on hover */
.sidebar.collapsed .sidebar-logo-icon img {
  transition: opacity 0.2s;
  width: 28px;
  height: 28px;
}

.sidebar.collapsed .sidebar-logo-icon::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background-image: url('/assets/sidebar.svg');
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scaleX(-1);
  transition: opacity 0.2s;
}

.sidebar.collapsed .sidebar-logo-icon:hover img {
  opacity: 0;
}

.sidebar.collapsed .sidebar-logo-icon:hover::after {
  opacity: 0.7;
}

.sidebar.collapsed .sidebar-logo-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar.collapsed .sidebar-actions {
  padding: 12px;
  align-items: center;
}

.sidebar.collapsed .sidebar-action-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
}

.sidebar.collapsed .sidebar-action-btn img {
  margin: 0;
}

.sidebar.collapsed .sidebar-content {
  display: none;
}

.sidebar.collapsed .sidebar-footer {
  padding: 12px;
  margin-top: auto;
}

.sidebar.collapsed .sidebar-user {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
}

/* Main content shift when sidebar is visible */
body.auth-subscribed .page-wrapper {
  margin-left: 260px;
  transition: margin-left 0.3s ease;
}

body.auth-subscribed.sidebar-collapsed .page-wrapper {
  margin-left: 56px;
}

/* Mode selector in header (for logged-in users) */
.mode-selector {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background-color 0.2s;
  position: absolute;
  left: 16px;  /* Small offset from header left edge (header already offset by sidebar) */
}

.mode-selector:hover {
  background-color: var(--color-bg-hover);
}

.mode-selector-text {
  font-size: 15px;
  font-weight: var(--font-weight-normal);
  color: var(--color-text-primary);
}

.mode-selector-chevron {
  width: 12px;
  height: 12px;
  opacity: 0.5;
}

/* ============================================================================
   HEADER / NAVIGATION
   ============================================================================ */
header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  height: 53px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05),
              inset 0 1px 0 rgba(255, 255, 255, 0.6);
  position: relative;
  z-index: 100;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  position: absolute;
  left: 24px;
}

.logo-icon {
  width: 28px;
  height: 28px;
}

.logo-icon img,
.logo-icon svg {
  width: 100%;
  height: 100%;
}

.logo-text {
  font-size: 16px;
  font-weight: var(--font-weight-normal);
  color: var(--color-text-primary);
}

.logo-chevron {
  width: 12px;
  height: 12px;
  margin-left: 2px;
  opacity: 0.5;
}

nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

nav > a {
  text-decoration: none;
  color: var(--color-text-primary);
  font-size: 14px;
  font-weight: var(--font-weight-light);
  padding: 8px 12px;
  border-radius: 20px;
  transition: background-color 0.2s, box-shadow 0.2s;
}

nav > a:hover {
  background-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.auth-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  position: absolute;
  right: 24px;
}

.btn-login {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: var(--font-weight-light);
  cursor: pointer;
  transition: background-color 0.2s;
}

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

.btn-signup {
  background-color: transparent;
  color: var(--color-text-primary);
  border: none;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: var(--font-weight-light);
  cursor: pointer;
}

.btn-signup:hover {
  color: var(--color-text-secondary);
}

.help-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--color-text-secondary);
}

/* ============================================================================
   HEADER ACTIONS (Share, More) - Top right corner for logged-in users
   ============================================================================ */
.header-actions {
  position: fixed;
  top: 16px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 100;
}

.header-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: var(--font-weight-normal);
  color: var(--color-text-secondary);
  transition: all 0.2s ease;
}

.header-action-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--color-text-primary);
}

.header-action-btn img {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.header-action-btn:hover img {
  opacity: 1;
}

.header-action-btn.header-action-icon-only {
  padding: 6px;
}

.header-action-btn.header-action-icon-only img {
  width: 14px;
  height: 14px;
}

/* Danger item in dropdown (for delete) */
.dropdown-item-danger {
  color: #dc3545;
}

.dropdown-item-danger:hover {
  background: #fff5f5;
}

.dropdown-item-danger img {
  filter: invert(27%) sepia(94%) saturate(2157%) hue-rotate(340deg) brightness(89%) contrast(97%);
}

/* ============================================================================
   MAIN CONTENT
   ============================================================================ */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 40px 24px;
  padding-bottom: 80px;
  position: relative;
  z-index: 1;
}

/* Dynamic Tagline - positioned above the panel */
.dynamic-tagline {
  font-size: 32px;
  font-weight: 300;
  color: var(--color-text-primary);
  text-align: center;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: absolute;
  top: calc(45vh - 180px);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Main Panel wrapper - anchored from bottom of viewport so it grows upward */
/* Centered in the content area (viewport minus sidebar width of 260px) */
.main-panel {
  position: fixed;
  bottom: 35vh;
  left: calc(260px + (100vw - 260px) / 2);
  transform: translateX(-50%);
}

.rotating-text {
  color: var(--color-primary);
  font-style: italic;
  font-weight: 300;
}

.cursor {
  color: var(--color-primary);
  animation: blink 1s infinite;
  font-weight: 300;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Main Glass Panel */
.main-panel {
  background: linear-gradient(135deg, rgba(250, 252, 255, 0.4) 0%, rgba(248, 250, 254, 0.45) 50%, rgba(245, 248, 252, 0.4) 100%);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.6);
  width: 100%;
  max-width: 720px;
  transition: all 0.3s ease;
}

.main-panel:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15),
              inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Hero Content - inside main-panel for anonymous users */
.hero-content {
  text-align: center;
  padding: 8px 0;
}

.hero-title {
  font-size: 28px;
  font-weight: 300;
  margin-bottom: 24px;
  text-align: center;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

.hero-title em {
  font-style: italic;
}

.hero-main-title {
  position: absolute;
  top: calc(45vh - 100px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 48px;
  font-weight: 600;
  color: var(--color-text-primary);
  text-align: center;
  margin: 0;
  letter-spacing: -0.02em;
}

.hero-auth-buttons {
  display: flex;
  gap: 24px;
  justify-content: center;
  position: absolute;
  top: calc(45vh + 10px);
  left: 50%;
  transform: translateX(-50%);
}

.hero-pricing-link {
  position: absolute;
  top: calc(45vh + 90px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.hero-pricing-link:hover {
  color: var(--color-text-primary);
  text-decoration: underline;
}

@media (orientation: portrait) {
  .dynamic-tagline {
    top: calc(35vh - 100px);
  }

  .hero-main-title {
    top: calc(35vh + 20px);
  }

  .hero-auth-buttons {
    flex-direction: column;
    align-items: center;
    top: calc(35vh + 180px);
    gap: 20px;
  }

  .hero-auth-buttons .btn-login,
  .hero-auth-buttons .btn-signup {
    padding: 18px 48px;
    font-size: 18px;
    min-width: 200px;
  }

  .hero-pricing-link {
    top: calc(35vh + 340px);
    font-size: 16px;
  }
}

.hero-auth-buttons .btn-login,
.hero-auth-buttons .btn-signup {
  padding: 12px 28px;
  font-size: 15px;
}

.hero-auth-buttons .btn-signup {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.hero-auth-buttons .btn-signup:hover {
  background: var(--color-bg-secondary);
}

/* ============================================================================
   INPUT CONTAINER
   ============================================================================ */
.input-container {
  width: 100%;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: all 0.3s ease;
}

.input-container:focus-within {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(99, 179, 237, 0.6);
  box-shadow: 0 0 0 4px rgba(99, 179, 237, 0.1);
}

.input-field {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 16px;
  color: var(--color-text-primary);
  resize: none;
  font-family: inherit;
  min-height: 24px;
  line-height: 1.6;
  overflow-y: hidden;
}

.input-field::placeholder {
  color: var(--color-text-muted);
}

/* Elegant scrollbar styling for textarea */
.input-field::-webkit-scrollbar {
  width: 6px;
}

.input-field::-webkit-scrollbar-track {
  background: transparent;
}

.input-field::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.input-field::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

.input-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background-color: var(--color-bg-primary);
  font-size: 13px;
  font-weight: var(--font-weight-light);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: background-color 0.2s;
}

.action-btn:hover {
  background-color: var(--color-bg-hover);
}

.action-btn svg {
  width: 16px;
  height: 16px;
}

.generate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background-color: var(--color-bg-hover);
  color: var(--color-text-muted);
  cursor: not-allowed;
  transition: all 0.2s;
  font-weight: var(--font-weight-light);
}

.generate-btn.active {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
  cursor: pointer;
}

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

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

/* ============================================================================
   FOOTER
   ============================================================================ */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 24px;
  text-align: center;
  font-size: 12px;
  color: var(--color-text-secondary);
  transition: all 0.3s ease;
  z-index: 9;
  background: transparent;
}

footer.above-banner {
  bottom: 80px;
}

/* Adjust footer position when sidebar is visible */
body.auth-subscribed footer {
  left: 260px;
}

body.auth-subscribed.sidebar-collapsed footer {
  left: 56px;
}

/* Footer text for logged-in users */
.footer-anonymous {
  display: block;
}

.footer-logged-in {
  display: none;
}

body.auth-subscribed .footer-anonymous,
body.auth-logged-in .footer-anonymous {
  display: none;
}

body.auth-subscribed .footer-logged-in,
body.auth-logged-in .footer-logged-in {
  display: block;
}

/* Hide footer for logged-in users - modes handle their own footer */
body.auth-subscribed footer,
body.auth-logged-in footer {
  display: none;
}

footer a {
  color: var(--color-text-primary);
  text-decoration: underline;
}

/* ============================================================================
   COOKIE BANNER
   ============================================================================ */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05),
              inset 0 1px 0 rgba(255, 255, 255, 0.6);
  z-index: 500;
}

.cookie-content {
  flex: 1;
}

.cookie-title {
  font-size: 14px;
  font-weight: var(--font-weight-normal);
  margin-bottom: 4px;
}

.cookie-text {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.cookie-text a {
  color: var(--color-text-primary);
  text-decoration: underline;
}

.cookie-buttons {
  display: flex;
  gap: 8px;
}

.cookie-btn {
  padding: 10px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: var(--font-weight-light);
  cursor: pointer;
  transition: all 0.2s;
}

.cookie-btn-manage {
  background-color: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
}

.cookie-btn-manage:hover {
  background-color: var(--color-bg-hover);
}

.cookie-btn-reject {
  background-color: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
}

.cookie-btn-reject:hover {
  background-color: var(--color-bg-hover);
}

.cookie-btn-accept {
  background-color: var(--color-primary);
  border: 1px solid var(--color-primary);
  color: var(--color-text-inverse);
}

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

/* ============================================================================
   FLOATING CIRCLES BACKGROUND (set display:none on .background-pattern to hide)
   ============================================================================ */
.background-pattern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.6;
  pointer-events: none;
}

.floating-circle {
  position: absolute;
  border-radius: 50%;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  animation: float 8s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg) scale(1);
    opacity: 0.6;
  }
  33% {
    transform: translateY(-30px) rotate(120deg) scale(1.1);
    opacity: 0.8;
  }
  66% {
    transform: translateY(15px) rotate(240deg) scale(0.9);
    opacity: 0.4;
  }
}

/* ============================================================================
   COOKIE MODAL
   ============================================================================ */
.cookie-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.cookie-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cookie-modal {
  background: var(--color-bg-primary);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  position: relative;
}

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

.cookie-modal-title {
  font-size: 18px;
  font-weight: var(--font-weight-medium);
}

.cookie-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.cookie-modal-close:hover {
  opacity: 1;
}

.cookie-modal-close img {
  width: 16px;
  height: 16px;
}

.cookie-modal-body {
  padding: 24px;
}

.cookie-modal-description {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.cookie-modal-description a {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Settings modal - positioned higher */
.settings-modal-overlay {
  align-items: flex-start;
  padding-top: 30vh;
}

.cookie-option {
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}

.cookie-option:last-child {
  border-bottom: none;
}

.cookie-option-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.cookie-option-title {
  font-size: 14px;
  font-weight: var(--font-weight-normal);
}

.cookie-option-description {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-border);
  transition: 0.3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--color-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.toggle-switch input:disabled + .toggle-slider {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================================================
   ADVANCED SETTINGS MODAL (for logged in users)
   ============================================================================ */
.settings-advanced-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.settings-advanced-overlay.active {
  opacity: 1;
  visibility: visible;
}

.settings-advanced-modal {
  background: var(--color-bg-primary);
  border-radius: 16px;
  width: 90%;
  max-width: 700px;
  max-height: 80vh;
  overflow: hidden;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.settings-advanced-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  z-index: 10;
  transition: background 0.2s;
}

.settings-advanced-close:hover {
  background: var(--color-bg-tertiary);
}

.settings-advanced-close img {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.settings-advanced-container {
  display: flex;
  flex-direction: row;
  min-height: 400px;
}

/* Left Navigation */
.settings-nav {
  display: flex;
  flex-direction: column;
  width: 200px;
  background: var(--color-bg-secondary);
  padding: 16px 12px;
  border-right: 1px solid var(--color-border);
  flex-shrink: 0;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text-primary);
  text-align: left;
  transition: background 0.15s;
}

.settings-nav-item:hover {
  background: var(--color-bg-tertiary);
}

.settings-nav-item.active {
  background: var(--color-bg-tertiary);
  font-weight: 500;
}

.settings-nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

/* Right Content */
.settings-content {
  flex: 1;
  padding: 24px 32px;
  overflow-y: auto;
}

.settings-section {
  display: none;
}

.settings-section.active {
  display: block;
}

.settings-section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.settings-option {
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}

.settings-option:last-child {
  border-bottom: none;
}

.settings-option-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.settings-option-label {
  font-size: 14px;
  font-weight: 500;
}

.settings-option-description {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-top: 4px;
  line-height: 1.5;
}

/* Danger option styling */
.settings-option-danger .settings-option-row {
  align-items: flex-start;
}

.settings-delete-btn {
  padding: 8px 16px;
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.settings-delete-btn:hover {
  background: #b91c1c;
}

/* Delete Account Confirmation Modal */
.delete-account-modal {
  text-align: center;
  padding: 32px;
}

.delete-account-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

.delete-account-cancel {
  padding: 12px 24px;
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.delete-account-cancel:hover {
  background: var(--color-border);
}

.delete-account-confirm {
  padding: 12px 24px;
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.delete-account-confirm:hover {
  background: #b91c1c;
}

.delete-account-confirm:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

/* Mobile responsive */
@media (max-width: 600px) {
  .settings-advanced-modal {
    width: 95%;
    max-height: 90vh;
  }

  .settings-advanced-container {
    flex-direction: column;
  }

  .settings-nav {
    flex-direction: row;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    gap: 4px;
    padding: 12px;
    overflow-x: auto;
  }

  .settings-nav-item {
    flex-shrink: 0;
    padding: 8px 16px;
  }

  .settings-content {
    padding: 20px;
  }
}

/* ============================================================================
   NAV DROPDOWNS (for tippy.js)
   ============================================================================ */
.nav-dropdown {
  background: var(--color-bg-primary);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 8px 0;
  min-width: 180px;
}

.dropdown-item {
  display: block;
  padding: 8px 16px;
  color: var(--color-text-primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: var(--font-weight-light);
  transition: background-color 0.2s;
  cursor: pointer;
}

.dropdown-item:hover {
  background-color: var(--color-bg-secondary);
}

/* Help dropdown with icons */
.help-dropdown {
  min-width: 200px;
}

.dropdown-item-with-icon {
  display: flex;
  align-items: center;
  white-space: nowrap;
  gap: 6px;
}

.dropdown-icon {
  width: 16px;
  height: 16px;
  opacity: 0.7;
  flex-shrink: 0;
}

.dropdown-divider {
  height: 1px;
  background-color: var(--color-border);
  margin: 8px 0;
}

/* Logo dropdown */
.logo-dropdown {
  min-width: 200px;
  padding: 0;
}

.logo-dropdown-content {
  padding: 20px;
}

.logo-dropdown-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.logo-dropdown-text {
  font-size: 14px;
  font-weight: 300;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.logo-dropdown-buttons {
  display: flex;
  gap: 8px;
}

.logo-dropdown-buttons .btn-login {
  flex: 0 0 auto;
}

.btn-signup-outline {
  background-color: transparent;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  padding: 10px 16px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: var(--font-weight-light);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-signup-outline:hover {
  background-color: var(--color-bg-hover);
  border-color: var(--color-text-muted);
}

/* ============================================================================
   AUTH MODAL
   ============================================================================ */
.auth-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.auth-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.auth-modal {
  background: var(--color-bg-primary);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 400px;
  box-shadow: var(--shadow-md);
  position: relative;
  padding: 32px;
}

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: opacity 0.2s;
  border-radius: 50%;
}

.auth-modal-close:hover {
  opacity: 1;
  background: var(--color-bg-secondary);
}

.auth-modal-close img {
  width: 20px;
  height: 20px;
}

.auth-modal-title {
  font-size: 24px;
  font-weight: var(--font-weight-medium);
  text-align: center;
  margin-bottom: 12px;
}

.auth-modal-subtitle {
  font-size: 15px;
  color: var(--color-text-secondary);
  text-align: center;
  margin-bottom: 28px;
  line-height: 1.5;
}

.auth-providers {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.auth-provider-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg-primary);
  font-size: 15px;
  font-weight: var(--font-weight-normal);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.auth-provider-btn:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-text-muted);
}

.auth-provider-btn img {
  width: 20px;
  height: 20px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.auth-divider-line {
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.auth-divider-text {
  font-size: 13px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-email-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-email-input {
  width: 100%;
  padding: 14px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
}

.auth-email-input:focus {
  border-color: var(--color-text-muted);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.auth-email-input::placeholder {
  color: var(--color-text-muted);
}

.auth-continue-btn {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-size: 15px;
  font-weight: var(--font-weight-normal);
  cursor: pointer;
  transition: all 0.2s;
}

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

.auth-continue-btn:disabled {
  background: var(--color-bg-secondary);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

/* ============================================================================
   MODE CONTAINER & MODE PANELS
   Container for all modes - spans area beside sidebar, responds to sidebar state
   ============================================================================ */
.mode-container {
  position: fixed;
  top: 0;
  left: 260px;  /* Sidebar width */
  right: 0;
  bottom: 0;
  overflow: hidden;
  transition: left 0.3s ease;
}

/* When sidebar is collapsed (56px width) */
body.sidebar-collapsed .mode-container {
  left: 56px;
}

/* Individual mode panels */
.mode-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  display: none;
}

.mode-panel.active {
  display: block;
}

.mode-panel.hidden {
  display: none;
}

/* ============================================================================
   MODE PLACEHOLDER STYLES (shared across all placeholder modes)
   ============================================================================ */
#mode-template,
#mode-chat,
#mode-workshop,
#mode-expert,
#mode-sketch {
  padding: 10px;
}

.template-content,
.mode-placeholder-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  min-height: 100%;
  gap: 40px;
  /* Glass blur background */
  background: linear-gradient(135deg, rgba(250, 252, 255, 0.4) 0%, rgba(248, 250, 254, 0.45) 50%, rgba(245, 248, 252, 0.4) 100%);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.coming-soon-container,
.mode-placeholder-container {
  text-align: center;
}

.coming-soon-title,
.mode-placeholder-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 12px;
}

.coming-soon-description,
.mode-placeholder-description {
  font-size: 16px;
  color: var(--color-text-secondary);
  max-width: 400px;
}

.demo-iframe-container,
.mode-placeholder-iframe-container {
  width: 100%;
  max-width: 640px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.demo-iframe,
.mode-placeholder-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ============================================================================
   CHAT MODE
   ============================================================================ */

/* Remove padding from chat mode container */
#mode-chat {
  padding: 0;
}

/* Chat start view - centers content in the mode panel */
.chat-start-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 40px 20px;
  box-sizing: border-box;
  position: relative;
}

/* Chat title - "Ready when you are." */
.chat-title {
  font-size: 32px;
  font-weight: 300;
  color: var(--color-text-primary);
  text-align: center;
  letter-spacing: -0.02em;
  margin: 0 0 40px 0;
}

/* Chat input panel - glass blur container */
.chat-input-panel {
  position: relative;
  background: linear-gradient(135deg, rgba(250, 252, 255, 0.4) 0%, rgba(248, 250, 254, 0.45) 50%, rgba(245, 248, 252, 0.4) 100%);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.6);
  width: 100%;
  max-width: 720px;
  transition: all 0.3s ease;
}

.chat-input-panel:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15),
              inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Timer for loading state */
.chat-timer {
  position: absolute;
  bottom: 12px;
  right: 20px;
  font-size: 11px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.chat-timer-value {
  font-weight: var(--font-weight-medium);
}

/* Pre-include spinner border to prevent layout shift */
.chat-input-panel {
  border: 4px solid transparent;
}

/* Spinning border loading effect */
.chat-input-panel.loading {
  --border-angle: 0deg;
  --border-color-1: rgba(99, 179, 237, 1);
  --border-color-2: rgba(147, 51, 234, 1);
  --spin-duration: 2s;
  pointer-events: none;
  background:
    linear-gradient(to right, rgb(250, 252, 255), rgb(250, 252, 255)) padding-box,
    conic-gradient(
      from var(--border-angle),
      transparent 0deg,
      transparent 260deg,
      var(--border-color-1) 290deg,
      var(--border-color-2) 330deg,
      transparent 360deg
    ) border-box;
  animation: border-spin var(--spin-duration) linear infinite;
}

/* Panel title - "Think in Cycles" */
.chat-panel-title {
  font-size: 22px;
  font-weight: 300;
  margin: 0 0 20px 0;
  text-align: center;
}

/* Model selector - positioned top-right of panel */
.chat-model-selector {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.2s;
}

.chat-model-selector:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.chat-model-selector.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.chat-model-text {
  font-size: 13px;
  font-weight: var(--font-weight-normal);
  color: var(--color-text-secondary);
}

.chat-model-chevron {
  width: 14px;
  height: 14px;
  opacity: 0.5;
}

/* Dropdown section labels */
.dropdown-section-label {
  padding: 8px 20px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Input container */
.chat-input-container {
  width: 100%;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: all 0.3s ease;
}

.chat-input-container:focus-within {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(99, 179, 237, 0.6);
  box-shadow: 0 0 0 4px rgba(99, 179, 237, 0.1);
}

/* Input field */
.chat-input-field {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 16px;
  color: var(--color-text-primary);
  resize: none;
  font-family: inherit;
  min-height: 24px;
  max-height: 200px;
  line-height: 1.6;
  overflow-y: auto;
}

.chat-input-field::placeholder {
  color: var(--color-text-muted);
}

/* Elegant scrollbar styling for chat textarea */
.chat-input-field::-webkit-scrollbar {
  width: 6px;
}

.chat-input-field::-webkit-scrollbar-track {
  background: transparent;
}

.chat-input-field::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.chat-input-field::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* Input actions row */
.chat-input-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.chat-action-buttons {
  display: flex;
  gap: 8px;
}

/* Attach button */
.chat-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background-color: var(--color-bg-primary);
  font-size: 13px;
  font-weight: var(--font-weight-light);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: background-color 0.2s;
}

.chat-action-btn:hover {
  background-color: var(--color-bg-hover);
}

.chat-action-btn svg {
  width: 16px;
  height: 16px;
}

/* Generate/submit button */
.chat-generate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background-color: var(--color-bg-hover);
  color: var(--color-text-muted);
  cursor: not-allowed;
  transition: all 0.2s;
}

.chat-generate-btn.active {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
  cursor: pointer;
}

.chat-generate-btn.active:hover {
  background-color: var(--color-primary-hover);
}

.chat-generate-btn.loading {
  background-color: var(--color-primary);
  cursor: wait;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

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

/* Disabled state for input field */
.chat-input-field:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================================================
   CHAT CONVERSATION VIEW
   ============================================================================ */

.chat-conversation-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  position: relative;
}

/* Conversation header with editable title */
.chat-conversation-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-border-light);
  flex-shrink: 0;
}

.chat-conversation-title {
  width: 100%;
  font-size: 24px;
  font-weight: 400;
  color: var(--color-text-primary);
  background: transparent;
  border: none;
  outline: none;
  text-align: center;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s;
}

.chat-conversation-title:hover {
  background-color: var(--color-bg-hover);
}

.chat-conversation-title:focus {
  background-color: var(--color-bg-secondary);
}

/* Main content area with diagram and description */
.chat-conversation-content {
  display: flex;
  flex: 1;
  min-height: 0;
  gap: 16px;
  padding: 16px;
  padding-right: 80px; /* Space for turn markers on the right */
}

/* Diagram panel (left side) */
.chat-diagram-panel {
  flex: 1;
  min-width: 0;
  background: linear-gradient(135deg, rgba(250, 252, 255, 0.4) 0%, rgba(248, 250, 254, 0.45) 50%, rgba(245, 248, 252, 0.4) 100%);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.chat-diagram-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Description panel (right side) */
.chat-description-panel {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.chat-description-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-text-primary);
}

.chat-description-content p {
  margin: 0 0 16px 0;
}

.chat-description-content p:last-child {
  margin-bottom: 0;
}

/* Elegant scrollbar for description */
.chat-description-content::-webkit-scrollbar {
  width: 6px;
}

.chat-description-content::-webkit-scrollbar-track {
  background: transparent;
}

.chat-description-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.chat-description-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* Discussion loading and error states */
.discussion-loading {
  color: var(--color-text-muted);
  font-style: italic;
}

.discussion-error {
  color: var(--color-text-muted);
  font-style: italic;
}

/* Turn markers area (placeholder for conversation turns) */
.chat-turn-markers {
  position: absolute;
  right: 16px;
  top: 0;
  bottom: 0;
  width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.chat-turn-marker {
  width: 32px;
  height: 3px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-turn-marker:hover {
  background: rgba(0, 0, 0, 0.3);
}

.chat-turn-marker.active {
  background: var(--color-primary);
  width: 40px;
}

/* Conversation input at bottom */
.chat-conversation-input {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding-bottom: 10px;
  margin-right: 80px; /* Match the turn markers space */
}

.chat-conv-input-wrapper {
  position: relative;
  max-width: 840px;
  width: 100%;
  padding: 40px 20px 20px 20px;
  background: linear-gradient(135deg, rgba(250, 252, 255, 0.6) 0%, rgba(248, 250, 254, 0.65) 50%, rgba(245, 248, 252, 0.6) 100%);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-radius: var(--radius-lg);
  /* 4px border always reserved to prevent layout shift when spinner activates */
  border: 4px solid transparent;
  transition: all 0.3s ease;
}

/* Timer for conversation loading state */
.chat-conv-timer {
  position: absolute;
  bottom: 6px;
  right: 20px;
  font-size: 11px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.chat-conv-timer-value {
  font-weight: var(--font-weight-medium);
}

/* Spinning border loading effect for conversation input */
.chat-conv-input-wrapper.loading {
  --border-angle: 0deg;
  --border-color-1: rgba(99, 179, 237, 1);
  --border-color-2: rgba(147, 51, 234, 1);
  --spin-duration: 2s;
  pointer-events: none;
  background:
    linear-gradient(to right, rgb(250, 252, 255), rgb(250, 252, 255)) padding-box,
    conic-gradient(
      from var(--border-angle),
      transparent 0deg,
      transparent 260deg,
      var(--border-color-1) 290deg,
      var(--border-color-2) 330deg,
      transparent 360deg
    ) border-box;
  animation: border-spin var(--spin-duration) linear infinite;
}

/* Model selector for conversation view - positioned top-right */
.chat-conv-model-selector {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.2s;
}

.chat-conv-model-selector:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.chat-conv-model-text {
  font-size: 12px;
  font-weight: var(--font-weight-normal);
  color: var(--color-text-muted);
}

.chat-conv-model-chevron {
  width: 12px;
  height: 12px;
  opacity: 0.5;
}

.chat-conv-input-container {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: all 0.3s ease;
}

.chat-conv-input-container:focus-within {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(99, 179, 237, 0.6);
  box-shadow: 0 0 0 4px rgba(99, 179, 237, 0.1);
}

/* Attach button (icon only) */
.chat-conv-attach-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-conv-attach-btn:hover {
  background-color: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.chat-conv-attach-btn svg {
  width: 18px;
  height: 18px;
}

/* Input field */
.chat-conv-input-field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 15px;
  color: var(--color-text-primary);
  resize: none;
  font-family: inherit;
  min-height: 24px;
  max-height: 120px;
  line-height: 1.5;
  overflow-y: auto;
}

.chat-conv-input-field::placeholder {
  color: var(--color-text-muted);
}

/* Elegant scrollbar for input */
.chat-conv-input-field::-webkit-scrollbar {
  width: 4px;
}

.chat-conv-input-field::-webkit-scrollbar-track {
  background: transparent;
}

.chat-conv-input-field::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 2px;
}

/* Send button */
.chat-conv-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background-color: var(--color-bg-hover);
  color: var(--color-text-muted);
  cursor: not-allowed;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-conv-send-btn.active {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
  cursor: pointer;
}

.chat-conv-send-btn.active:hover {
  background-color: var(--color-primary-hover);
}

.chat-conv-send-btn svg {
  width: 16px;
  height: 16px;
}

/* ============================================================================
   TOAST NOTIFICATIONS
   ============================================================================ */

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease, top 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.show {
  opacity: 1;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 768px) {
  nav {
    display: none;
  }

  .hero-title {
    font-size: 22px;
  }

  .hero-auth-buttons .btn-login,
  .hero-auth-buttons .btn-signup {
    padding: 10px 22px;
    font-size: 14px;
  }

  .cookie-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .cookie-buttons {
    width: 100%;
    flex-wrap: wrap;
  }

  .cookie-btn {
    flex: 1;
    text-align: center;
  }
}
