/* Base Styles & Variables */
:root {
  --primary-green: #4CAF50;
  --primary-blue: #2196F3;
  --accent-purple: #7E57C2;
  --accent-orange: #FF9800;
  --accent-pink: #E91E63;
  --white: #FFFFFF;
  --light-bg: #F8F9FA;
  --dark-bg: #121212;
  --text-dark: #333333;
  --text-light: #666666;
  --border-light: #E0E0E0;
  --success: #28A745;
  --warning: #FFC107;
  --error: #DC3545;
  --info: #17A2B8;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-success: linear-gradient(135deg, #4CAF50, #45a049);
  --gradient-warning: linear-gradient(135deg, #FF9800, #F57C00);
  --gradient-danger: linear-gradient(135deg, #FF5252, #F44336);
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  background: var(--light-bg);
  font-family: "Poppins", sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: block;
  transition: all 0.3s ease;
  overflow-x: hidden;
    background-color: #00BFFF;
}

.app {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

/* Header Styles */
.header-section {
  text-align: center;
  margin-bottom: 20px;
  padding: 0 10px;
}

.logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.logo-text {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary-green);
  letter-spacing: 1px;
  margin: 0;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.ai-text {
  color: var(--primary-blue);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  font-size: 1.1rem;
  color: var(--text-light);
  margin: 0;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Theme Toggle */
.theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

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

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

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

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

input:checked + .slider:before {
  transform: translateX(26px);
}

#theme-label {
  font-size: 0.9rem;
  color: var(--text-dark);
}

/* Stats Bar */
.stats-bar {
  display: flex;
  justify-content: space-around;
  width: 100%;
  background: var(--white);
  padding: 15px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.stat-item i {
  font-size: 1.2rem;
  color: var(--primary-blue);
}

.stat-item span:first-of-type {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-dark);
}

.stat-item span:last-of-type {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* API Selection Section */
.api-selection-section {
  width: 100%;
  margin-bottom: 20px;
  padding: 20px;
  background: var(--white);
  border-radius: 15px;
  box-shadow: var(--shadow-md);
}

.api-selection-section h4 {
  text-align: center;
  margin-bottom: 15px;
  color: var(--text-dark);
  font-size: 1.1rem;
}

.api-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 15px;
}

.api-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.api-option:hover {
  border-color: var(--primary-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.api-option.active {
  border-color: var(--primary-green);
  background: #f0fff4;
  transform: scale(1.02);
}

.api-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.api-name {
  font-weight: 500;
  color: var(--text-dark);
  flex: 1;
}

.api-status {
  font-size: 0.8rem;
  font-weight: bold;
  flex-shrink: 0;
}

.api-info {
  background: #e8f5e8;
  border: 1px solid var(--primary-green);
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  font-size: 0.9rem;
  display: block;
}

#api-description {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 5px;
  font-style: italic;
}

/* Business Type Section */
.business-type-section {
  width: 100%;
  margin-bottom: 20px;
}

.business-type-section h4 {
  text-align: center;
  margin-bottom: 15px;
  color: var(--text-dark);
  font-size: 1.1rem;
}

.business-type-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 15px;
}

.business-type-card {
  background: var(--white);
  border: 2px solid var(--border-light);
  border-radius: 12px;
  padding: 15px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.business-type-card:hover {
  border-color: var(--primary-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.business-type-card.active {
  border-color: var(--primary-green);
  background: #f0f8ff;
  transform: scale(1.05);
}

.business-type-card span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dark);
}

.business-icon {
  font-size: 1.5rem;
  color: var(--primary-blue);
}

/* Tone Button Styles */
.tone-btn {
  background: #fff;
  color: #222;
  border: 2px solid #d0d0d0;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tone-btn:hover {
  background: #f8f8f8;
  border-color: #bdbdbd;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.tone-btn.active {
  background: #f0faff;
  border-color: #2196f3;
  color: #0d47a1;
  box-shadow: 0 0 12px rgba(33, 150, 243, 0.4);
  transform: scale(1.05);
}

/* Template Section */
.template-section {
  width: 100%;
  margin-bottom: 20px;
}

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

.template-header h3 {
  margin: 0;
  color: var(--text-dark);
  font-size: 1.1rem;
}

.skip-btn {
  background: #6c757d;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.skip-btn:hover {
  background: #5a6268;
  transform: translateY(-1px);
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 15px;
}

.template-card {
  background: var(--white);
  border: 2px solid var(--border-light);
  border-radius: 12px;
  padding: 15px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.template-card:hover {
  border-color: var(--primary-green);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.template-card.active {
  border-color: var(--primary-green);
  background: #f8fff8;
  transform: scale(1.02);
}

.template-card.suggested {
  border-color: var(--primary-blue);
  background: #f0f8ff;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(33, 150, 243, 0); }
  100% { box-shadow: 0 0 0 0 rgba(33, 150, 243, 0); }
}

.template-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
  color: var(--primary-blue);
}

.template-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dark);
  line-height: 1.2;
  word-break: break-word;
  text-align: center;
}

.template-info {
  background: #e8f5e8;
  border: 1px solid var(--primary-green);
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

/* Advanced Options */
.advanced-options {
  width: 100%;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: #f8f9fa;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
}

.accordion-header h4 {
  margin: 0;
  color: var(--text-dark);
  font-size: 1rem;
}

.accordion-toggle {
  color: var(--text-light);
  transition: transform 0.3s ease;
}

.accordion-content {
  padding: 20px;
  display: none;
}

.advanced-options.active .accordion-content {
  display: block;
}

.advanced-options.active .accordion-toggle {
  transform: rotate(180deg);
}

.advanced-controls {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

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

.control-group label {
  font-weight: 500;
  color: var(--text-dark);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.control-group select {
  padding: 10px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--white);
  font-size: 0.9rem;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

#creativity-slider {
  flex: 1;
}

#creativity-value {
  min-width: 40px;
  text-align: center;
  font-weight: 500;
}

/* Smart Input Section */
.smart-input-section {
  width: 100%;
  background: var(--white);
  border-radius: 15px;
  box-shadow: var(--shadow-md);
  padding: 20px;
  margin-bottom: 20px;
}

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

.input-header h4 {
  margin: 0;
  color: var(--text-dark);
  font-size: 1.1rem;
}

.smart-btn {
  background: var(--accent-purple);
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.3s ease;
}

.smart-btn:hover {
  background: #6a51b3;
  transform: translateY(-1px);
}

.input-container {
  margin-bottom: 15px;
}

#user-input {
  width: 100%;
  padding: 15px;
  border: 2px solid var(--border-light);
  border-radius: 10px;
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color 0.3s ease;
  font-family: inherit;
}

#user-input:focus {
  outline: none;
  border-color: var(--primary-blue);
}

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

.input-stats {
  display: flex;
  gap: 15px;
  font-size: 0.8rem;
  color: var(--text-light);
}

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

.action-btn {
  background: #6c757d;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.3s ease;
}

.action-btn:hover {
  background: #5a6268;
  transform: translateY(-1px);
}

/* Quick Prompts */
.quick-prompts {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 15px;
}

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

.prompts-header span {
  font-weight: 500;
  color: var(--text-dark);
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 5px;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.icon-btn:hover {
  background: var(--border-light);
  color: var(--text-dark);
}

.prompts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.prompt-item {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.8rem;
  text-align: center;
}

.prompt-item:hover {
  border-color: var(--primary-blue);
  transform: translateY(-1px);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  width: 100%;
  justify-content: center;
}

.generate-btn, .batch-btn, .analyze-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.generate-btn {
  background: var(--gradient-success);
  color: white;
  flex: 2;
}

.batch-btn {
  background: var(--gradient-primary);
  color: white;
  flex: 1;
}

.analyze-btn {
  background: var(--gradient-warning);
  color: white;
  flex: 1;
}

.generate-btn:hover, .batch-btn:hover, .analyze-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Chat Section */
.chat-section {
  width: 100%;
  background: var(--white);
  border-radius: 15px;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
  overflow: hidden;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: #f8f9fa;
  border-bottom: 1px solid var(--border-light);
}

.chat-header h4 {
  margin: 0;
  color: var(--text-dark);
  font-size: 1.1rem;
}

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

.chat-container {
  height: 400px;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* ✅ IMPROVED AI Output Styles */
.ai-output {
  background: linear-gradient(135deg, #f8fff8 0%, #f0f8ff 100%);
  border: 2px solid #4CAF50;
  border-radius: 12px;
  padding: 20px;
  margin: 10px 0;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.1);
}

.ai-output h3 {
  color: #2E7D32;
  margin-bottom: 15px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.output-text {
  white-space: pre-wrap;
  line-height: 1.6;
  color: #333;
  font-size: 0.95rem;
  background: white;
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid #4CAF50;
}

/* Message Styles */
.user-msg, .bot-msg {
  display: flex;
  width: 100%;
}

.user-msg {
  justify-content: flex-end;
}

.bot-msg {
  justify-content: flex-start;
  flex-direction: column;
  align-items: flex-start;
}

.user-msg .bubble, .bot-msg .bubble {
  padding: 12px 16px;
  border-radius: 18px;
  max-width: 70%;
  line-height: 1.4;
  font-size: 0.9rem;
  word-break: break-word;
  box-shadow: var(--shadow-sm);
}

.user-msg .bubble {
  background: var(--gradient-primary);
  color: white;
  border-bottom-right-radius: 5px;
}

.bot-msg .bubble {
  background: linear-gradient(135deg, #F8F9FA 0%, var(--white) 100%);
  color: var(--text-dark);
  border-bottom-left-radius: 5px;
  margin-bottom: 5px;
  border: 1px solid var(--border-light);
}

/* Copy Button */
.copy-btn {
  background: #2196F3 !important;
  color: white !important;
  border: none !important;
  padding: 8px 15px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  margin-top: 10px !important;
  font-size: 0.8rem !important;
  transition: all 0.3s ease !important;
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
}

.copy-btn:hover {
  background: #1976D2 !important;
  transform: translateY(-1px) !important;
}

.copy-btn.copied {
  background: #4CAF50 !important;
}

/* Content Tools */
.content-tools {
  width: 100%;
  background: var(--white);
  border-radius: 15px;
  box-shadow: var(--shadow-md);
  padding: 20px;
  margin-bottom: 20px;
}

.tools-header {
  margin-bottom: 15px;
}

.tools-header h4 {
  margin: 0;
  color: var(--text-dark);
  font-size: 1.1rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.tool-btn {
  background: #f8f9fa;
  border: 2px solid var(--border-light);
  border-radius: 10px;
  padding: 12px 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.tool-btn:hover {
  border-color: var(--primary-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.tool-btn i {
  font-size: 1.2rem;
  color: var(--primary-blue);
}

.tool-btn span {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-dark);
  text-align: center;
}

/* Social Media Section */
.social-media-section {
  width: 100%;
  margin: 20px 0;
  padding: 20px;
  background: var(--white);
  border-radius: 15px;
  box-shadow: var(--shadow-md);
}

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

.social-header h4 {
  margin: 0;
  color: var(--text-dark);
  font-size: 1.1rem;
}

.social-stats {
  background: var(--primary-green);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.social-buttons-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.social-post-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 10px;
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.8rem;
  position: relative;
}

.social-post-btn:hover {
  background: #e9ecef;
  border-color: var(--primary-green);
  transform: translateY(-2px);
}

.social-post-btn.connected {
  background: #d4edda;
  border-color: var(--success);
  color: #155724;
}

.social-post-btn i {
  font-size: 1.2rem;
}

.social-text {
  font-weight: 500;
  flex: 1;
}

.post-count {
  background: var(--primary-blue);
  color: white;
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 500;
}

/* Image Generation Section */
.image-generation-section {
  width: 100%;
  background: var(--white);
  border-radius: 15px;
  box-shadow: var(--shadow-md);
  padding: 20px;
  margin-bottom: 20px;
}

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

.image-header h4 {
  margin: 0;
  color: var(--text-dark);
  font-size: 1.1rem;
}

.image-btn {
  background: var(--accent-pink);
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.3s ease;
}

.image-btn:hover {
  background: #d81b60;
  transform: translateY(-1px);
}

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

.image-input {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 0.9rem;
}

.image-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.image-result {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}

.image-result img {
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 8px;
}

/* Export Section */
.export-section {
  width: 100%;
  background: var(--white);
  border-radius: 15px;
  box-shadow: var(--shadow-md);
  padding: 20px;
  margin-bottom: 20px;
}

.export-header {
  margin-bottom: 15px;
}

.export-header h4 {
  margin: 0;
  color: var(--text-dark);
  font-size: 1.1rem;
}

.export-buttons {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.export-btn {
  background: #f8f9fa;
  border: 2px solid var(--border-light);
  border-radius: 10px;
  padding: 12px 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
}

.export-btn:hover {
  border-color: var(--primary-green);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.export-btn i {
  font-size: 1.2rem;
  color: var(--primary-blue);
}

/* Content Preview Section */
.content-preview-section {
  width: 100%;
  background: var(--white);
  border-radius: 15px;
  box-shadow: var(--shadow-md);
  padding: 20px;
  margin-bottom: 20px;
}

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

.preview-header h4 {
  margin: 0;
  color: var(--text-dark);
  font-size: 1.1rem;
}

.preview-actions select {
  padding: 6px 10px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--white);
  font-size: 0.8rem;
}

.content-preview {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 20px;
  min-height: 200px;
  border: 2px dashed var(--border-light);
}

.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-light);
  text-align: center;
}

.preview-placeholder i {
  font-size: 3rem;
  margin-bottom: 10px;
  opacity: 0.5;
}

.platform-preview {
  background: white;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.preview-content {
  white-space: pre-wrap;
  line-height: 1.5;
}

.preview-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e0e0e0;
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Sidebars */
.history-sidebar, .analytics-sidebar, .settings-sidebar {
  position: fixed;
  top: 0;
  width: 350px;
  height: 100vh;
  background: var(--white);
  box-shadow: var(--shadow-xl);
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.history-sidebar {
  right: -370px;
}

.analytics-sidebar {
  left: -370px;
}

.settings-sidebar {
  right: -370px;
  top: 0;
}

.history-sidebar.active, .analytics-sidebar.active, .settings-sidebar.active {
  transform: translateX(0);
}

.history-sidebar.active {
  right: 0;
}

.analytics-sidebar.active {
  left: 0;
}

.settings-sidebar.active {
  right: 0;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: var(--gradient-primary);
  color: white;
}

.sidebar-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 5px;
  border-radius: 4px;
  transition: background 0.3s ease;
}

.close-btn:hover {
  background: rgba(255,255,255,0.2);
}

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

/* History List */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 12px;
  transition: all 0.3s ease;
}

.history-item:hover {
  border-color: var(--primary-blue);
}

.history-text {
  font-size: 0.9rem;
  margin-bottom: 8px;
  line-height: 1.4;
}

.history-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-light);
}

.delete-history-btn {
  background: none;
  border: none;
  color: var(--error);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.3s ease;
}

.delete-history-btn:hover {
  background: rgba(220, 53, 69, 0.1);
}

.sidebar-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.clear-btn, .search-btn {
  background: #6c757d;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.3s ease;
}

.clear-btn:hover, .search-btn:hover {
  background: #5a6268;
}

/* Analytics Stats */
.analytics-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.stat-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-blue);
  margin-bottom: 5px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-light);
}

.charts-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chart-section {
  margin-bottom: 20px;
}

.chart-section h5 {
  margin-bottom: 10px;
  color: var(--text-dark);
}

.chart {
  background: #f8f9fa;
  border-radius: 8px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
}

/* Settings */
.settings-section {
  margin-bottom: 20px;
}

.settings-section h5 {
  margin-bottom: 10px;
  color: var(--text-dark);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 5px;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px 0;
}

.setting-item label {
  font-size: 0.9rem;
  color: var(--text-dark);
}

.setting-item select {
  padding: 6px 10px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--white);
  font-size: 0.8rem;
}

.setting-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

/* Sidebar Toggle Buttons */
.sidebar-toggle {
  position: fixed;
  top: 20px;
  background: var(--gradient-primary);
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 999;
  box-shadow: var(--shadow-lg);
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.history-toggle {
  right: 20px;
}

.analytics-toggle {
  left: 20px;
}

.settings-toggle {
  right: 80px;
}

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

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.loading-overlay.active {
  display: flex;
}

.loading-content {
  background: var(--white);
  padding: 30px;
  border-radius: 15px;
  text-align: center;
  max-width: 400px;
  width: 90%;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

.loading-details {
  display: flex;
  justify-content: space-around;
  margin-top: 15px;
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Notification System */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notification {
  background: var(--white);
  padding: 15px 20px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 300px;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.notification.success {
  border-left: 4px solid var(--success);
}

.notification.error {
  border-left: 4px solid var(--error);
}

.notification.warning {
  border-left: 4px solid var(--warning);
}

.notification.info {
  border-left: 4px solid var(--info);
}

/* Dark Mode Styles */
body.dark-mode {
  background-color: var(--dark-bg);
  color: #f7f8fa;
}

body.dark-mode .app > div:not(.header-section) {
  background: #2d3748;
  color: #e2e8f0;
}

body.dark-mode .logo-text {
  color: var(--primary-green);
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

body.dark-mode .ai-text {
  background: linear-gradient(45deg, #64b5f6, var(--primary-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.dark-mode .tagline {
  color: #ccc;
}

/* Update all component styles for dark mode */
body.dark-mode .api-option,
body.dark-mode .business-type-card,
body.dark-mode .template-card,
body.dark-mode .tool-btn,
body.dark-mode .social-post-btn,
body.dark-mode .export-btn,
body.dark-mode .tone-btn {
  background: #4a5568;
  border-color: #718096;
  color: #e2e8f0;
}

body.dark-mode .api-option.active,
body.dark-mode .business-type-card.active,
body.dark-mode .template-card.active,
body.dark-mode .tone-btn.active {
  background: #2d4d2d;
  border-color: var(--primary-green);
}

body.dark-mode .api-info,
body.dark-mode .template-info {
  background: #2d4d2d;
  border-color: var(--primary-green);
  color: #e2e8f0;
}

body.dark-mode .ai-output {
  background: linear-gradient(135deg, #2d4d2d 0%, #2d3748 100%);
  border-color: var(--primary-green);
}

body.dark-mode .output-text {
  background: #4a5568;
  color: #e2e8f0;
  border-left-color: var(--primary-green);
}

body.dark-mode .bot-msg .bubble {
  background: #4a5568 !important;
  color: #e2e8f0 !important;
  border-color: #718096 !important;
}

body.dark-mode .input-container #user-input,
body.dark-mode .image-input,
body.dark-mode .preview-actions select,
body.dark-mode .control-group select {
  background: #4a5568;
  border-color: #718096;
  color: #e2e8f0;
}

body.dark-mode .quick-prompts,
body.dark-mode .content-preview {
  background: #4a5568;
  border-color: #718096;
}

body.dark-mode .history-item,
body.dark-mode .stat-card,
body.dark-mode .chart {
  background: #4a5568;
  border-color: #718096;
  color: #e2e8f0;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .business-type-grid,
  .template-grid,
  .tools-grid,
  .social-buttons-grid,
  .export-buttons {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .api-selector-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .app {
    max-width: 100%;
    padding: 10px;
  }
  
  .business-type-grid,
  .template-grid,
  .tools-grid,
  .social-buttons-grid,
  .export-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .api-selector-grid {
    grid-template-columns: 1fr;
  }
  
  .advanced-controls {
    grid-template-columns: 1fr;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .sidebar-toggle {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .history-sidebar,
  .analytics-sidebar,
  .settings-sidebar {
    width: 300px;
  }
  
  .theme-toggle {
    position: relative;
    top: 0;
    right: 0;
    margin-bottom: 10px;
  }
}

@media (max-width: 480px) {
  .business-type-grid,
  .template-grid,
  .tools-grid,
  .social-buttons-grid,
  .export-buttons {
    grid-template-columns: 1fr;
  }
  
  .logo-text {
    font-size: 2rem;
  }
  
  .tagline {
    font-size: 1rem;
  }
  
  .user-msg .bubble,
  .bot-msg .bubble {
    max-width: 90%;
  }
  
  .business-type-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .template-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}peat(2, 1fr);
  }
}

.image-result {
  text-align: center;
  margin-top: 10px;
}

.image-result img {
  max-width: 100%;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.image-result button {
  margin-top: 6px;
  background: #ff007f;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.image-output-box {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  margin-top: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

/* Preview Box Styling */
.content-preview {
  background: var(--card-bg, #fff);
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 16px;
  min-height: 120px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: all 0.3s ease-in-out;
}

.preview-placeholder {
  text-align: center;
  color: #777;
  padding: 20px;
}

.platform-preview strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1rem;
}

/* Platform-specific colors */
.facebook-preview { border-left: 5px solid #1877f2; }
.instagram-preview { border-left: 5px solid #e1306c; }
.twitter-preview { border-left: 5px solid #1da1f2; }
.linkedin-preview { border-left: 5px solid #0077b5; }

.mic-btn {
  background: #ff7f50;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  font-size: 18px;
  cursor: pointer;
  transition: 0.3s;
}
.mic-btn.listening {
  background: #4caf50;
  box-shadow: 0 0 10px rgba(76,175,80,0.5);
}ition: border-color 0.3s ease;
}

#voiceInput:focus {
  outline: none;
  border-color: var(--primary-blue);
}

.mic-btn {
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
}

.mic-btn:hover {
  transform: scale(1.05);
}

.mic-btn.listening {
  background: var(--gradient-success);
  box-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
}


.premium-center-btn {
  text-align: center;
  margin-top: 40px;      /* ऊपर से spacing */
  margin-bottom: 40px;   /* नीचे से spacing */
}

.action-btn.premium-btn {
  background: linear-gradient(90deg, #2563eb, #1d4ed8);
  color: #ffffff;
  padding: 8px 18px;     /* compact height/width */
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.25);
  transition: all 0.3s ease;
}

.action-btn.premium-btn:hover {
  background: linear-gradient(90deg, #1d4ed8, #2563eb);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.3);
}

.action-btn.premium-btn {
  background: linear-gradient(90deg, #f59e0b, #facc15);
  box-shadow: 0 3px 8px rgba(245, 158, 11, 0.3);
}
.action-btn.premium-btn:hover {
  background: linear-gradient(90deg, #facc15, #f59e0b);
}

.btns-center {
  text-align: center;         /* सब कुछ center में */
  margin-top: 40px;
  margin-bottom: 40px;
}

.btns-center .action-btn {
  margin: 6px;                /* थोड़ा gap दोनों बटनों में */
}

/* AI Loading Styles */
.ai-loader {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
}

.loader-core {
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, #4F46E5, #7E22CE);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: ai-pulse 2s ease-in-out infinite;
}

.loader-orbits {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-top: 2px solid #4F46E5;
    border-radius: 50%;
    animation: ai-rotate 3s linear infinite;
}

.loader-orbits:nth-child(2) {
    width: 60px;
    height: 60px;
    top: 10px;
    left: 10px;
    border-top: 2px solid #7E22CE;
    animation: ai-rotate 2s linear infinite reverse;
}

.loader-orbits:nth-child(3) {
    width: 40px;
    height: 40px;
    top: 20px;
    left: 20px;
    border-top: 2px solid #10B981;
    animation: ai-rotate 4s linear infinite;
}

.loading-stages {
    display: flex;
    justify-content: space-between;
    margin: 1.5rem 0;
    position: relative;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.loading-stages::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: #e5e7eb;
    z-index: 1;
}

.stage {
    text-align: center;
    z-index: 2;
    position: relative;
    flex: 1;
}

.stage-dot {
    width: 16px;
    height: 16px;
    background: #e5e7eb;
    border-radius: 50%;
    margin: 0 auto 0.5rem;
    position: relative;
    z-index: 3;
}

.stage.active .stage-dot {
    background: #4F46E5;
    animation: stage-glow 1.5s ease-in-out infinite;
}

.stage-name {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
}

.stage.active .stage-name {
    color: #4F46E5;
    font-weight: 600;
}

.progress-container {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin: 1rem 0;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4F46E5, #7E22CE);
    border-radius: 10px;
    width: 65%;
    animation: progress-move 2s ease-in-out infinite;
}

.ai-tips {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid #4F46E5;
    margin-top: 1rem;
}

.tip-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: #4F46E5;
    font-weight: 600;
}

/* Animations */
@keyframes ai-pulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.8;
    }
}

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

@keyframes stage-glow {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4);
    }
    50% { 
        box-shadow: 0 0 0 6px rgba(79, 70, 229, 0.1);
    }
}

@keyframes progress-move {
    0%, 100% { 
        width: 65%;
        opacity: 1;
    }
    50% { 
        width: 75%;
        opacity: 0.8;
    }
}


/* Glass Effect */
.glass-nav {
  background: rgba(255,255,255,0.06);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* Underline Animation */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg,#6366f1,#a78bfa);
  transition: width .25s;
}
.nav-link:hover::after {
  width: 100%;
}

/* Mobile Slide Animation */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.menu-animate { animation: slideDown .3s ease-out; }
  background: linear-gradient(135deg, rgba(99,102,241,0.4), rgba(139,92,246,0.4));
  border: 1px solid rgba(255,255,255,0.3);
  transition: 0.4s;
}

.glass-btn:hover {
  transform: scale(1.07);
  background: linear-gradient(135deg, rgba(139,92,246,0.7), rgba(99,102,241,0.7));
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.6);
}

/* 📱 Mobile Links */
.mobile-link {
  display: block;
  padding: 10px;
  border-radius: 8px;
  backdrop-filter: blur(10px);
  color: white;
  transition: 0.3s;
}

.mobile-link:hover {
  background: rgba(255, 255, 255, 0.2);
}

#red {
color:black;
text-decoration:none;
}


/* Navbar */
.navbar {
  width: 100%;
  padding: 12px 20px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 999;
  border-bottom: 1px solid #e3e3e3;
}

.logo {
  font-size: 20px;
  font-weight: bold;
  color: #2b7cff;
}

.nav-right a {
  margin-left: 20px;
  text-decoration: none;
  color: #333;
  font-weight: 500;
}

/* Mobile toggle button */
.nav-toggle {
  display: none;
  font-size: 28px;
  cursor: pointer;
}

/* Mobile menu */
.mobile-menu {
  display: none;
  flex-direction: column;
  background: #fff;
  padding: 15px;
  border-bottom: 1px solid #ddd;
}

.mobile-menu a {
  padding: 10px 0;
  text-decoration: none;
  color: #333;
  font-size: 18px;
  border-bottom: 1px solid #eee;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-right { display: none; }
  .nav-toggle { display: block; }

  .mobile-menu.active {
    display: flex;
  }
}