/* Page de démarrage - Design minimaliste et scientifique */

:root {
  --startup-bg: #ffffff;
  --startup-text: #1a1a1a;
  --startup-border: #e0e0e0;
  --startup-primary: #2563eb;
  --startup-primary-hover: #1d4ed8;
  --startup-secondary: #64748b;
  --startup-input-bg: #f8fafc;
  --startup-shadow: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
  --startup-bg: #0f172a;
  --startup-text: #f1f5f9;
  --startup-border: #334155;
  --startup-primary: #3b82f6;
  --startup-primary-hover: #2563eb;
  --startup-secondary: #94a3b8;
  --startup-input-bg: #1e293b;
  --startup-shadow: rgba(0, 0, 0, 0.3);
}

body.startup-page {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background: var(--startup-bg);
  color: var(--startup-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.startup-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
  box-sizing: border-box;
}

.startup-header {
  text-align: center;
  margin-bottom: 3rem;
  animation: fadeInDown 0.6s ease-out;
}

.startup-logo {
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--startup-primary), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.startup-tagline {
  font-size: 1.1rem;
  color: var(--startup-secondary);
  font-weight: 400;
}

.startup-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 0.8s ease-out;
}

.startup-messages {
  flex: 1;
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.startup-message {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  max-width: 85%;
  animation: slideIn 0.3s ease-out;
}

.startup-message.user {
  background: var(--startup-primary);
  color: white;
  align-self: flex-end;
  margin-left: auto;
}

.startup-message.assistant {
  background: var(--startup-input-bg);
  border: 1px solid var(--startup-border);
  align-self: flex-start;
}

.startup-message.assistant.streaming::after {
  content: '▊';
  animation: blink 1s infinite;
  margin-left: 2px;
}

.startup-input-zone {
  background: var(--startup-input-bg);
  border: 2px solid var(--startup-border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px var(--startup-shadow);
}

.startup-input-zone:focus-within {
  border-color: var(--startup-primary);
  box-shadow: 0 8px 24px var(--startup-shadow);
}

.startup-textarea {
  width: 100%;
  min-height: 120px;
  max-height: 300px;
  border: none;
  background: transparent;
  color: var(--startup-text);
  font-size: 1.1rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  padding: 0;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.startup-textarea::placeholder {
  color: var(--startup-secondary);
  opacity: 0.6;
}

.startup-files-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--startup-border);
}

.startup-file-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--startup-bg);
  border: 1px solid var(--startup-border);
  border-radius: 8px;
  font-size: 0.9rem;
}

.startup-file-item i {
  color: var(--startup-primary);
}

.startup-file-remove {
  background: none;
  border: none;
  color: var(--startup-secondary);
  cursor: pointer;
  padding: 0;
  margin-left: 0.25rem;
  font-size: 1.1rem;
  transition: color 0.2s;
}

.startup-file-remove:hover {
  color: #ef4444;
}

.startup-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.startup-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

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

.startup-btn-secondary {
  background: var(--startup-bg);
  color: var(--startup-text);
  border: 1px solid var(--startup-border);
}

.startup-btn-secondary:hover:not(:disabled) {
  background: var(--startup-input-bg);
  border-color: var(--startup-primary);
}

.startup-btn-primary {
  background: var(--startup-primary);
  color: white;
  margin-left: auto;
}

.startup-btn-primary:hover:not(:disabled) {
  background: var(--startup-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.startup-footer {
  text-align: center;
  margin-top: 2rem;
  padding: 1rem;
  color: var(--startup-secondary);
  font-size: 0.9rem;
}

.startup-footer a {
  color: var(--startup-primary);
  text-decoration: none;
  transition: opacity 0.2s;
}

.startup-footer a:hover {
  opacity: 0.8;
}

.startup-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

.startup-modal-content {
  background: var(--startup-bg);
  padding: 2.5rem;
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.4s ease-out;
}

.startup-modal h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--startup-text);
  font-size: 1.5rem;
}

.startup-modal p {
  color: var(--startup-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.startup-modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.startup-theme-toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  background: var(--startup-input-bg);
  border: 1px solid var(--startup-border);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1.2rem;
}

.startup-theme-toggle:hover {
  transform: scale(1.1);
  border-color: var(--startup-primary);
}

input[type="file"] {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

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

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

@media (max-width: 768px) {
  .startup-container {
    padding: 1rem;
  }

  .startup-header {
    margin-bottom: 2rem;
  }

  .startup-logo {
    font-size: 2rem;
  }

  .startup-tagline {
    font-size: 1rem;
  }

  .startup-textarea {
    font-size: 1rem;
    min-height: 100px;
  }

  .startup-controls {
    gap: 0.5rem;
  }

  .startup-btn {
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    flex: 1;
    justify-content: center;
  }

  .startup-btn-primary {
    margin-left: 0;
    flex-basis: 100%;
  }

  .startup-message {
    max-width: 90%;
  }

  .startup-modal-content {
    padding: 1.5rem;
  }

  .startup-modal-actions {
    flex-direction: column;
  }

  .startup-modal-actions .startup-btn {
    width: 100%;
  }
}
