/* ViaTriAi Main Application Styles */
/* Extracted from viatriai_inner_page.html for performance optimization */

:root {
  --primary-blue: #1e40af;
  --primary-blue-dark: #1e3a8a;
  --secondary-purple: #3aa2ed;
  --accent-green: #10b981;
  --accent-orange: #f59e0b;
  --accent-pink: #ec4899;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --border-light: #e5e7eb;
  --border-medium: #d1d5db;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header Modernization */
header {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  color: white;
  padding: 1rem 2rem;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-img {
  height: 40px;
  width: auto;
  border-radius: var(--radius-md);
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(45deg, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.membership-badge {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-pro { background: linear-gradient(45deg, #ec4899, #be185d); }
.badge-elite { background: linear-gradient(45deg, #f59e0b, #d97706); }
.badge-trial { background: linear-gradient(45deg, #ef4444, #dc2626); }

/* Main Content */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* Daily Booster Modern Card */
.daily-booster {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.daily-booster::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #f59e0b, #d97706, #f59e0b);
}

.booster-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.booster-text {
  flex: 1;
  min-width: 300px;
}

.booster-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.booster-description {
  color: var(--accent-green);
  font-weight: 500;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.booster-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-fun {
  background: linear-gradient(135deg, #c084fc, #9333ea);
  color: white;
  padding: 0.4rem 0.75rem;
  border-radius: 1rem;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Modern Button System */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
  color: white;
}

.btn-secondary {
  background: linear-gradient(135deg, var(--text-secondary), #4b5563);
  color: white;
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-green), #059669);
  color: white;
}

.btn-warning {
  background: linear-gradient(135deg, var(--accent-orange), #d97706);
  color: white;
}

.btn-purple {
  background: linear-gradient(135deg, var(--secondary-purple), #6d28d9);
  color: white;
}

.btn-pink {
  background: linear-gradient(135deg, var(--accent-pink), #db2777);
  color: white;
}

.btn-gray {
  background: linear-gradient(135deg, #6b7280, #4b5563) !important;
  color: white !important;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

/* Prompt Box Modernization */
.prompt-section {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}

.prompt-textarea {
  width: 100%;
  min-height: 120px;
  padding: 1rem;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  transition: border-color 0.2s ease;
  background: var(--bg-secondary);
}

.prompt-textarea:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgb(30 64 175 / 0.1);
}

.upload-section {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
}

/* Magic Tools Panel */
.magic-panel {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.magic-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border-bottom: 1px solid var(--border-light);
}

.magic-panel-content {
  padding: 0;
}

.tool-section {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-light);
}

.tool-section:last-child {
  border-bottom: none;
}

.tool-section-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tool-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.form-select {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  font-size: 0.875rem;
  min-width: 180px;
}

.form-select:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgb(30 64 175 / 0.1);
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.checkbox-item input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary-blue);
}

.highlight {
  background-color: yellow;
  padding: 0 2px;
  border-radius: 2px;
}

/* AI Columns Modernization */
.toggle-section {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.ai-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.ai-column {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ai-column:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.ai-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.ai-column h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.ai-controls {
  display: flex;
  gap: 0.5rem;
}

.ai-response {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  font-family: 'SF Mono', Monaco, monospace;
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.6;
  min-height: 150px;
  border: 1px solid var(--border-light);
}

.integration-bar {
  background: var(--bg-tertiary);
  padding: 1rem;
  border-radius: var(--radius-md);
  margin: 1rem 0;
}

.integration-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.integration-link {
  color: var(--secondary-purple);
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
  transition: color 0.2s ease;
}

.integration-link:hover {
  color: var(--primary-blue);
}

.confidence-meter {
  margin-top: 1.5rem;
}

.progress-bar {
  background: var(--bg-tertiary);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-green), #22c55e);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.confidence-label {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Image Generation Section */
.image-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin: 2rem 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.image-column {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}

.image-box {
  min-height: 200px;
  background: var(--bg-secondary);
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Summary Section */
.summary-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin: 2rem 0;
}

@media (min-width: 1024px) {
  .summary-section {
    grid-template-columns: 1fr 1fr;
  }
}

.summary-card {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}

.summary-card h2 {
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.summary-content {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  font-family: 'SF Mono', Monaco, monospace;
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.6;
  border: 1px solid var(--border-light);
}

/* Pinned Section */
.pinned-section {
  background: var(--bg-primary);
  border: 2px solid var(--accent-green);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin: 3rem 0;
  box-shadow: var(--shadow-lg);
}

.pinned-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-green);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
}

/* Sketch Modal - Minimal CSS for proper display */
#sketchModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.sketch-container {
  background: white;
  border-radius: 10px;
  padding: 20px;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
}

#sketchCanvas {
  border: 2px solid #ccc !important;
  border-radius: 5px;
  background: white !important;
  display: block !important;
  margin: 10px auto;
  cursor: crosshair !important;
  touch-action: none !important;
  width: 600px;
  height: 400px;
}

/* Enhanced Feature Cards */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.header {
  text-align: center;
  color: white;
  margin-bottom: 3rem;
}

.header h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header p {
  font-size: 1.2rem;
  opacity: 0.9;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.feature-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.feature-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #2d3748;
}

.feature-description {
  color: #4a5568;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.active {
  display: flex;
}

.modal-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.5rem;
}

.modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Canvas Styles */
.canvas-wrapper {
  position: relative;
  display: inline-block;
  margin: 1rem 0;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.canvas-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 0.5rem;
}

.canvas-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  padding: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.canvas-btn:hover {
  background: white;
  transform: scale(1.05);
}

/* Input Groups */
.input-group {
  margin: 1.5rem 0;
  text-align: left;
}

.input-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #2d3748;
}

.input-group input,
.input-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.input-group input:focus,
.input-group textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Notification Styles */
.notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
  color: white;
  padding: 1rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(81, 207, 102, 0.3);
  z-index: 1001;
  display: none;
  animation: slideUp 0.3s ease;
}

/* Rotate Banner */
.rotate-banner {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 193, 7, 0.15);
  color: #333;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  backdrop-filter: blur(6px);
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.rotate-banner.show {
  display: block;
  opacity: 1;
}

/* Upgrade Banner */
.upgrade-banner {
  background: linear-gradient(135deg, #ffd43b 0%, #fab005 100%);
  color: #333;
  padding: 1.5rem;
  border-radius: 15px;
  margin-bottom: 2rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(255, 212, 59, 0.3);
}

.upgrade-banner h3 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

/* AI Detector Styles */
.ai-detector {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 2px solid #22c55e;
  border-radius: 15px;
  padding: 1.5rem;
  margin-top: 1rem;
}

.result-box {
  background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
  border-left: 4px solid #fb923c;
  border-radius: 10px;
  padding: 1rem;
  margin: 1rem 0;
  font-weight: 600;
  color: #b45309;
  display: none;
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

/* Responsive Container Adjustments */
.main-box,
.response-box,
.card,
.booster-card {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  padding: 1rem;
}

/* Flex Utilities */
.flex {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.flex-col {
  flex-direction: column;
}

/* Loading Shimmer Effect */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 1.5s infinite;
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

/* Animations */
@keyframes slideUp {
  from {
    transform: translateX(-50%) translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

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

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

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

/* Mobile Responsive Styles */
@media (max-width: 600px) {
  .booster-content {
    flex-direction: column;
    align-items: stretch;
  }

  #cardContainer {
    align-self: center;
  }

  #toggleBtn {
    margin-top: 1rem;
    position: static !important;
  }

  .booster-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .booster-actions button {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .ai-columns {
    grid-template-columns: 1fr;
  }

  .image-section {
    grid-template-columns: 1fr;
  }

  .tool-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    justify-content: center;
  }

  .ai-response-box {
    flex-direction: column;
  }

  .ai-response-box > div {
    width: 100%;
  }

  .button,
  .action-button {
    font-size: 1rem;
    padding: 10px;
    width: 100%;
  }

  .booster-card {
    margin-bottom: 1rem;
  }

  .container {
    padding: 1rem;
  }

  .header h1 {
    font-size: 2rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .modal-content {
    margin: 1rem;
  }

  .modal-buttons {
    flex-direction: column;
  }

  .canvas-wrapper {
    width: 100%;
    max-width: 100%;
  }

  #sketchCanvas {
    width: 100%;
    height: 300px;
  }
}

/* Utility Classes */
.hidden { display: none; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }