/* DESIGN SYSTEM & VARIABLES */
:root {
  /* Color Palette */
  --bg-primary: #FCFBF8;
  --bg-secondary: #F7F5F1;
  --bg-card: #FFFFFF;
  
  --accent-primary: #6D8B74;       /* Sage Green */
  --accent-primary-hover: #5d7863;
  --accent-primary-light: rgba(109, 139, 116, 0.08);
  
  --accent-secondary: #B8A8D8;     /* Lavender */
  --accent-secondary-hover: #a391c7;
  --accent-secondary-light: rgba(184, 168, 216, 0.12);
  
  --accent-highlight: #E8D5B7;     /* Warm Sand */
  --accent-highlight-light: rgba(232, 213, 183, 0.2);
  
  --success: #8F9779;              /* Muted Olive */
  --border-color: #ECE8E2;
  --border-color-hover: #DFD9D0;
  
  /* Text Colors */
  --text-primary: #222222;         /* Dark Charcoal */
  --text-secondary: #707070;
  --text-muted: #A09E9A;
  
  /* Typography */
  --font-display: 'Outfit', 'SF Pro Display', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  
  /* Layout Sizing & Spacing */
  --sidebar-width: 260px;
  --right-panel-width: 350px;
  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  /* Shadows & Blurs */
  --shadow-sm: 0 2px 8px rgba(34, 34, 34, 0.03);
  --shadow-md: 0 10px 30px -10px rgba(109, 139, 116, 0.06);
  --shadow-lg: 0 16px 40px -12px rgba(34, 34, 34, 0.06);
  --glass-blur: blur(12px);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(236, 232, 226, 0.6);
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* RESET & CORE STYLES */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

/* CUSTOM SCROLLBARS */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

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

@keyframes floatGlow {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -50px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
  100% { transform: translate(0, 0) scale(1); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

/* AMBIENT FLOATING GRADIENTS */
.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.glow-1 {
  top: -10%;
  left: 20%;
  width: 45vw;
  height: 45vw;
  background-color: var(--accent-secondary-light);
  animation: floatGlow 25s infinite alternate ease-in-out;
}

.glow-2 {
  bottom: 10%;
  right: 5%;
  width: 40vw;
  height: 40vw;
  background-color: var(--accent-primary-light);
  animation: floatGlow 30s infinite alternate-reverse ease-in-out;
  animation-delay: -5s;
}

.glow-3 {
  top: 40%;
  left: -5%;
  width: 35vw;
  height: 35vw;
  background-color: var(--accent-highlight-light);
  animation: floatGlow 28s infinite alternate ease-in-out;
  animation-delay: -10s;
}

/* APP MAIN CONTAINER */
.app-container {
  position: relative;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr var(--right-panel-width);
  width: 100%;
  height: 100vh;
  z-index: 1;
}

/* LEFT SIDEBAR */
.sidebar {
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  height: 100%;
  z-index: 10;
}

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

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary), var(--accent-highlight));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.logo-inner {
  width: 16px;
  height: 16px;
  background-color: var(--bg-card);
  border-radius: 50%;
  display: inline-block;
}

.logo-text h1 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.logo-text .tagline {
  font-size: 10px;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mobile-close {
  display: none;
  color: var(--text-secondary);
  padding: 4px;
}

.sidebar-nav {
  flex-grow: 1;
  overflow-y: auto;
}

.sidebar-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.nav-item svg {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.6);
  color: var(--text-primary);
}

.nav-item:hover svg {
  color: var(--accent-primary);
}

.nav-item.active {
  background-color: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.nav-item.active svg {
  color: var(--accent-primary);
}

.nav-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 12px 16px;
}

.badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  background-color: var(--accent-primary-light);
  color: var(--accent-primary);
  border-radius: 12px;
  letter-spacing: 0.02em;
}

.sidebar-user {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.user-avatar-wrapper {
  position: relative;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  border: 2px solid var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.gradient-avatar {
  background: linear-gradient(135deg, var(--accent-highlight), var(--accent-secondary-hover));
}

.status-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}

.status-indicator.online {
  background-color: var(--success);
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-email {
  font-size: 11px;
  color: var(--text-secondary);
}

.settings-trigger {
  margin-left: auto;
  color: var(--text-muted);
  padding: 6px;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.settings-trigger:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.8);
}

/* MAIN WRAPPER */
.main-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* TOP NAV */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 40px;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  z-index: 5;
}

.top-nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-toggle {
  display: none;
  color: var(--text-primary);
  padding: 4px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.crumb {
  color: var(--text-secondary);
  font-weight: 500;
}

.crumb.active {
  color: var(--text-primary);
  font-weight: 600;
}

.crumb-separator {
  color: var(--text-muted);
}

.top-nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.link-item {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.link-item:hover {
  color: var(--text-primary);
}

.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-secondary);
  position: relative;
  transition: all var(--transition-fast);
}

.icon-button:hover {
  color: var(--text-primary);
  border-color: var(--border-color-hover);
  transform: translateY(-1px);
}

.notification-btn .badge-dot {
  position: absolute;
  top: 10px;
  right: 11px;
  width: 6px;
  height: 6px;
  background-color: var(--accent-secondary);
  border-radius: 50%;
  border: 1px solid var(--bg-card);
}

.primary-cta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  background-color: var(--accent-primary);
  color: var(--bg-primary);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.primary-cta:hover {
  background-color: var(--accent-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* MAIN CONTENT */
.main-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.main-content > * {
  flex-shrink: 0;
}

/* HERO SECTION */
.hero-section {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 40px 48px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  animation: fadeIn 0.8s var(--transition-normal);
}

.hero-text-content {
  max-width: 580px;
  position: relative;
  z-index: 2;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.gradient-text {
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.organic-illustrations {
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 320px;
  height: 200px;
  pointer-events: none;
  z-index: 1;
}

.shape {
  position: absolute;
  width: 140px;
  height: 140px;
}

.shape-1 {
  top: 10px;
  right: 60px;
  animation: floatGlow 15s infinite alternate ease-in-out;
}

.shape-2 {
  bottom: 0px;
  right: 150px;
  animation: floatGlow 18s infinite alternate-reverse ease-in-out;
  animation-delay: -3s;
}

.shape-3 {
  top: 50px;
  right: 20px;
  animation: floatGlow 20s infinite alternate ease-in-out;
  animation-delay: -6s;
}

/* FEATURE CARDS */
.feature-cards {
  display: flex;
  gap: 24px;
  animation: fadeIn 0.9s var(--transition-normal);
}

.feature-card {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-lg);
}

.card-icon {
  font-size: 24px;
  background-color: var(--bg-secondary);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.feature-card:hover .card-icon {
  background-color: var(--accent-primary-light);
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.feature-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* MAIN WORKSPACE PANELS */
.workspace-area {
  display: flex;
  align-items: stretch;
  gap: 24px;
  position: relative;
  animation: fadeIn 1s var(--transition-normal);
}

.workspace-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  height: 440px;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.workspace-panel:focus-within {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(252, 251, 248, 0.5);
  backdrop-filter: var(--glass-blur);
}

.panel-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

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

.panel-btn {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.panel-btn.action-copy:hover {
  border-color: var(--accent-primary);
  background-color: var(--accent-primary-light);
  color: var(--accent-primary);
}

.editor-wrapper, .output-wrapper {
  flex-grow: 1;
  position: relative;
  padding: 24px;
  overflow: hidden;
}

.editor-wrapper textarea {
  width: 100%;
  height: 100%;
  border: none;
  resize: none;
  outline: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
}

.editor-wrapper textarea::placeholder {
  color: var(--text-muted);
}

/* Drag-and-Drop overlay */
.drag-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  background-color: rgba(252, 251, 248, 0.95);
  border: 2px dashed var(--accent-primary);
  border-radius: var(--radius-lg);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.drag-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--accent-primary);
  font-weight: 500;
}

.panel-left.dragover .drag-overlay {
  opacity: 1;
}

/* Output Styling */
.output-content {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-wrap;
  user-select: text;
}

.output-content:empty::before {
  content: attr(placeholder);
  color: var(--text-muted);
}

.panel-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
}

.character-counter {
  color: var(--text-secondary);
}

.status-indicator-text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.status-indicator-text::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--success);
}

.status-indicator-text.loading::before {
  background-color: var(--accent-secondary);
  animation: pulse 1s infinite;
}

/* Floating Center Rewrite Button */
.center-action-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.center-action-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px -6px rgba(109, 139, 116, 0.4);
  position: relative;
  transition: all var(--transition-normal);
}

.center-action-btn:hover {
  transform: scale(1.08) rotate(15deg);
  box-shadow: 0 12px 28px -4px rgba(109, 139, 116, 0.5);
}

.center-action-btn svg {
  position: relative;
  z-index: 2;
  transition: transform var(--transition-fast);
}

.center-action-btn:hover svg {
  transform: translateX(2px);
}

.btn-ripple {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid var(--accent-secondary);
  opacity: 0.3;
  pointer-events: none;
  transform: scale(1);
  animation: pulse 2.5s infinite;
}

/* SKELETON LOADER ANIMATION */
.skeleton-loader {
  position: absolute;
  top: 24px;
  left: 24px;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: var(--bg-card);
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.skeleton-loader.active {
  opacity: 1;
  pointer-events: all;
}

.skeleton-line {
  height: 16px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-secondary);
}

.shimmer {
  background: linear-gradient(90deg, #F0EDE8 25%, #E6E2D8 50%, #F0EDE8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
}

/* BOTTOM CONTROLS & CONTROLS GRID */
.bottom-controls {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: flex-end;
  animation: fadeIn 1.1s var(--transition-normal);
}

.control-group {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-group label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.select-wrapper {
  position: relative;
  width: 100%;
}

.select-wrapper select {
  width: 100%;
  appearance: none;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
}

.select-wrapper select:hover {
  border-color: var(--border-color-hover);
  background-color: #f2efea;
}

.select-wrapper select:focus {
  border-color: var(--accent-primary);
  background-color: var(--bg-card);
  box-shadow: 0 0 0 3px var(--accent-primary-light);
}

.select-wrapper::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--text-secondary);
  pointer-events: none;
}

/* Slider Controls */
.slider-group {
  flex: 1.5;
  min-width: 240px;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-primary);
  background-color: var(--accent-primary-light);
  padding: 2px 8px;
  border-radius: 12px;
}

.slider-wrapper {
  position: relative;
  padding-top: 8px;
}

.slider-wrapper input[type="range"] {
  width: 100%;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--border-color);
  outline: none;
  transition: background 0.3s;
}

/* range slider thumb */
.slider-wrapper input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 2px solid var(--bg-card);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.slider-wrapper input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: var(--accent-primary-hover);
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.slider-ticks span {
  width: 33.33%;
  text-align: center;
}

.slider-ticks span:first-child { text-align: left; }
.slider-ticks span:last-child { text-align: right; }

.action-group {
  flex: 1.2;
  min-width: 200px;
}

.primary-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 24px;
  border-radius: var(--radius-md);
  background-color: var(--accent-primary);
  color: var(--bg-primary);
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(109, 139, 116, 0.2);
  transition: all var(--transition-normal);
}

.primary-action-btn:hover {
  background-color: var(--accent-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(109, 139, 116, 0.3);
}

.primary-action-btn svg {
  transition: transform var(--transition-fast);
}

.primary-action-btn:hover svg {
  transform: translateX(3px);
}

/* BOTTOM STRIP / PRIVACY */
.bottom-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  font-size: 13px;
  color: var(--text-secondary);
}

.privacy-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-icon {
  font-size: 14px;
}

.badge-text strong {
  font-weight: 600;
  color: var(--text-primary);
}

.badge-text span {
  margin-left: 4px;
}

.learn-more-link {
  font-weight: 600;
  color: var(--accent-primary);
  transition: color var(--transition-fast);
}

.learn-more-link:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

/* RIGHT PANEL: VOICE PROFILE INSIGHTS */
.right-panel {
  background-color: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  height: 100%;
  overflow-y: auto;
  z-index: 10;
  position: relative;
}

.right-panel-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.panel-section-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.right-panel-header .subtext {
  font-size: 12px;
  color: var(--text-secondary);
}

.insight-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-subtitle {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Profile Summary Card */
.profile-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: linear-gradient(180deg, var(--bg-card) 0%, #FAF9F6 100%);
}

.profile-card-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-tag {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 20px;
  background-color: var(--accent-secondary-light);
  color: #7d6ba1;
  border: 1px solid rgba(184, 168, 216, 0.3);
}

.profile-card-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-indicators {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.indicator-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-secondary);
}

.indicator-label {
  font-size: 10px;
  color: var(--text-secondary);
}

.indicator-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.highlight-val {
  color: var(--accent-primary);
}

/* Style tags */
.style-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 20px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.tag:hover {
  background-color: var(--accent-primary-light);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* Transformations */
.transformations-section {
  flex-grow: 1;
}

.transformation-carousel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.transformation-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
}

.state-label {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 4px;
}

.original-label {
  background-color: #F0EDE8;
  color: var(--text-secondary);
}

.rewriten-label {
  background-color: var(--accent-primary-light);
  color: var(--accent-primary);
}

.trans-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.original-text {
  font-style: italic;
}

.rewriten-text {
  color: var(--text-primary);
  font-weight: 500;
}

.transition-arrow {
  text-align: center;
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 600;
}

.view-more-btn {
  width: 100%;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-primary);
  border: 1px dashed var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 10px;
  text-align: center;
  transition: all var(--transition-fast);
}

.view-more-btn:hover {
  background-color: var(--accent-primary-light);
  border-style: solid;
}

.mobile-close-right {
  display: none;
}

/* MODALS & POP-UPS */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(34, 34, 34, 0.4);
  backdrop-filter: var(--glass-blur);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  width: 500px;
  max-width: 90%;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(20px);
  transition: transform var(--transition-normal);
}

.modal-backdrop.active .modal-card {
  transform: translateY(0);
}

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

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  color: var(--text-secondary);
  padding: 4px;
  border-radius: 50%;
  transition: background-color var(--transition-fast);
}

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

.modal-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.api-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.api-input-wrapper input {
  width: 100%;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 12px 48px 12px 16px;
  font-size: 14px;
  outline: none;
  font-family: monospace;
  transition: all var(--transition-fast);
}

.api-input-wrapper input:focus {
  border-color: var(--accent-primary);
  background-color: var(--bg-card);
  box-shadow: 0 0 0 3px var(--accent-primary-light);
}

.toggle-password {
  position: absolute;
  right: 14px;
  color: var(--text-secondary);
  padding: 4px;
}

.toggle-password:hover {
  color: var(--text-primary);
}

.help-text {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.help-text a {
  color: var(--accent-primary);
  font-weight: 500;
}

.help-text a:hover {
  text-decoration: underline;
}

.form-group.row-group {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* Switch styling */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

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

.slider-round:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

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

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

.modal-footer {
  padding: 24px 32px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background-color: var(--bg-secondary);
}

/* Markdown documentation style modal */
.doc-modal {
  width: 600px;
}

.markdown-content h4 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
  text-transform: uppercase;
}

.markdown-content p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.markdown-content ul, .markdown-content ol {
  padding-left: 20px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.markdown-content li {
  margin-bottom: 6px;
}

/* RESPONSIVE DESIGN - MEDIA QUERIES */

/* 1. LAPTOP viewport (1440px or under) */
@media (max-width: 1440px) {
  :root {
    --sidebar-width: 240px;
    --right-panel-width: 310px;
  }
  .main-content {
    padding: 30px;
    gap: 30px;
  }
  .hero-section {
    padding: 32px 40px;
  }
  .hero-title {
    font-size: 32px;
  }
  .organic-illustrations {
    width: 240px;
    right: -10px;
  }
  .workspace-panel {
    height: 400px;
  }
  .bottom-controls {
    padding: 24px;
    gap: 20px;
  }
}

/* 2. TABLET viewport (1024px or under) */
@media (max-width: 1023px) {
  .app-container {
    grid-template-columns: 1fr; /* Stack sidebars on mobile drawer */
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: var(--sidebar-width);
    height: 100vh;
    transition: left var(--transition-normal);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.active {
    left: 0;
  }

  .right-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: var(--right-panel-width);
    height: 100vh;
    transition: right var(--transition-normal);
    box-shadow: var(--shadow-lg);
  }

  .right-panel.active {
    right: 0;
  }

  .mobile-close, .mobile-close-right {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
  }

  .mobile-close-right {
    position: absolute;
    top: 32px;
    left: -16px;
    z-index: 100;
  }

  .mobile-toggle {
    display: flex;
  }

  .top-nav {
    padding: 20px 24px;
  }

  .main-content {
    padding: 24px;
    gap: 24px;
  }
  
  .hero-section {
    padding: 24px;
  }

  .organic-illustrations {
    display: none; /* Hide background illustrations on tablets */
  }

  .workspace-area {
    flex-direction: column;
  }

  .center-action-wrapper {
    margin: -12px 0;
    transform: rotate(90deg); /* Arrow points down on stacked */
  }
  
  .center-action-btn:hover {
    transform: scale(1.08) rotate(105deg);
  }

  .workspace-panel {
    height: 320px;
  }
}

/* 3. MOBILE viewport (768px or under) */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 280px;
    --right-panel-width: 290px;
  }

  .top-nav-right .link-item,
  .top-nav-right #apiConfigBtnHeader {
    display: none; /* Hide non-essential headers on mobile */
  }

  .breadcrumbs {
    font-size: 13px;
  }

  .crumb-separator, .breadcrumbs .crumb:first-child {
    display: none; /* Simplify breadcrumbs */
  }

  .feature-cards {
    flex-direction: column;
    gap: 16px;
  }

  .bottom-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }

  .control-group {
    min-width: 100%;
  }

  .bottom-strip {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 16px 24px;
  }
}

/* TAB DISPLAY AND TRANSITIONS */
.tab-content {
  display: none;
  animation: fadeIn var(--transition-normal);
}

.tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* MY VOICE PROFILE VIEW */
.profile-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.profile-detail-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.profile-detail-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

.profile-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
  line-height: 1.5;
}

.profile-rules-box h4 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  color: var(--accent-primary);
}

.profile-rules-box ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-rules-box li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.profile-rules-box strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 2px;
}

.structure-flow {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.flow-step {
  padding: 14px 20px;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
  border-left: 4px solid var(--accent-primary);
  line-height: 1.4;
}

.flow-step strong {
  color: var(--text-primary);
  margin-right: 8px;
}

/* WRITING SAMPLES VIEW */
.samples-container {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.sample-editor-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.sample-editor-card h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.existing-samples-list h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.samples-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.sample-item-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sample-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sample-format {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--accent-primary-light);
  color: var(--accent-primary);
  padding: 2px 8px;
  border-radius: 12px;
}

.sample-date {
  font-size: 11px;
  color: var(--text-muted);
}

.sample-item-card h4 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
}

.sample-excerpt {
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.5;
}

/* TONE LIBRARY VIEW */
.tones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.tone-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all var(--transition-fast);
}

.tone-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.tone-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tone-header h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

.tone-badge {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--accent-primary-light);
  color: var(--accent-primary);
  padding: 2px 8px;
  border-radius: 10px;
}

.tone-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.add-tone-card {
  border: 2px dashed var(--border-color);
  background: transparent;
  justify-content: center;
  align-items: center;
  text-align: center;
  cursor: pointer;
}

.add-tone-card:hover {
  border-style: solid;
  background-color: var(--bg-card);
}

.add-tone-card h3 {
  color: var(--accent-primary);
}

/* HISTORY VIEW */
.history-table-wrapper {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.history-table th {
  background-color: var(--bg-secondary);
  padding: 16px 24px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}

.history-table td {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.history-table tr:last-child td {
  border-bottom: none;
}

.table-action-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-primary);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--accent-primary);
  background: transparent;
  transition: all var(--transition-fast);
}

.table-action-btn:hover {
  background-color: var(--accent-primary-light);
}

/* FAVORITES VIEW */
.favorites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.favorites-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.fav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fav-tag {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--accent-primary-light);
  color: var(--accent-primary);
  padding: 2px 8px;
  border-radius: 10px;
}

.fav-action-btn {
  color: var(--accent-highlight);
  font-size: 18px;
}

.fav-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.6;
}

.fav-footer {
  display: flex;
  justify-content: flex-end;
}

/* ANALYTICS VIEW */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.analytics-stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.analytics-stat-card h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

.metric-progress-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.metric-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.metric-info span {
  color: var(--text-secondary);
}

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

.progress-bar-fill {
  height: 100%;
  background-color: var(--accent-primary);
  border-radius: 4px;
}

.stat-highlights {
  display: flex;
  gap: 40px;
}

.stat-highlight-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  color: var(--accent-primary);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
}

/* WORKSPACE SETTINGS VIEW */
.settings-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 600px;
}

.settings-card h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

.settings-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-form-group label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

.settings-form-group.row-group {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

@media (max-width: 1023px) {
  .profile-dashboard-grid, .samples-grid, .analytics-grid {
    grid-template-columns: 1fr;
  }
}

