/* Reset et base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  color: #f1f5f9;
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 40px;
  padding: 40px 0;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.logo {
  width: 50px;
  height: 50px;
  border-radius: 12px;
}

header p {
  font-size: 1.1rem;
  opacity: 0.8;
  color: #94a3b8;
}

/* Sections */
.section {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.9));
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 30px;
  margin-bottom: 30px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.section h2 {
  margin-bottom: 20px;
  color: #e2e8f0;
  font-size: 1.8rem;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 20px;
  margin-top: 30px;
  justify-content: center;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #cbd5e1;
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.8);
  color: #f1f5f9;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input::placeholder {
  color: #64748b;
}

.form-group small {
  display: block;
  margin-top: 5px;
  color: #94a3b8;
  font-size: 0.85rem;
}

.form-buttons {
  display: flex;
  gap: 15px;
  margin-top: 25px;
}

.form-buttons button {
  flex: 1;
}

/* Input with button (generate/toggle) */
.input-with-button {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-with-button input {
  flex: 1;
}

.btn-generate,
.btn-toggle {
  padding: 10px 14px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
}

.btn-generate:hover,
.btn-toggle:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: #3b82f6;
  transform: scale(1.05);
}

.btn-generate:active,
.btn-toggle:active {
  transform: scale(0.95);
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-danger {
  padding: 14px 28px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(45deg, #3b82f6, #1d4ed8);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(45deg, #2563eb, #1e40af);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: rgba(71, 85, 105, 0.8);
  color: #e2e8f0;
  border: 1px solid rgba(71, 85, 105, 0.5);
}

.btn-secondary:hover {
  background: rgba(71, 85, 105, 1);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(45deg, #ef4444, #dc2626);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(45deg, #dc2626, #b91c1c);
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Session Header */
.session-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.session-info h2 {
  margin-bottom: 10px;
}

.session-meta {
  display: flex;
  gap: 20px;
  color: #94a3b8;
  font-size: 0.9rem;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  border-bottom: 2px solid rgba(59, 130, 246, 0.2);
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 12px 24px;
  color: #94a3b8;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.tab-btn:hover {
  color: #e2e8f0;
}

.tab-btn.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Upload Area */
.upload-zone {
  margin-bottom: 30px;
}

.upload-area {
  border: 3px dashed rgba(59, 130, 246, 0.5);
  border-radius: 16px;
  padding: 40px 20px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  background: rgba(59, 130, 246, 0.05);
}

.upload-area:hover,
.upload-area.dragover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 15px;
  opacity: 0.7;
}

.upload-area h3 {
  font-size: 1.2rem;
  margin-bottom: 15px;
  color: #e2e8f0;
}

/* Files Section */
.files-section h3 {
  margin-bottom: 20px;
  color: #e2e8f0;
  font-size: 1.3rem;
}

.files-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  transition: all 0.3s ease;
}

.file-item:hover {
  background: rgba(15, 23, 42, 0.8);
  border-color: #3b82f6;
  transform: translateX(5px);
}

.file-info-item {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
}

.file-icon {
  font-size: 2rem;
}

.file-details h4 {
  color: #e2e8f0;
  font-size: 1rem;
  margin-bottom: 5px;
}

.file-details p {
  color: #94a3b8;
  font-size: 0.85rem;
}

.file-actions {
  display: flex;
  gap: 10px;
}

.btn-download,
.btn-delete {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-download {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.btn-download:hover {
  background: rgba(34, 197, 94, 0.3);
}

.btn-delete {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-delete:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* Chat Container */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 500px;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: rgba(15, 23, 42, 0.4);
  border-radius: 12px;
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.messages-container::-webkit-scrollbar {
  width: 8px;
}

.messages-container::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.3);
  border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.5);
}

.message {
  padding: 12px 16px;
  background: rgba(71, 85, 105, 0.3);
  border-radius: 12px;
  max-width: 70%;
  border: 1px solid rgba(71, 85, 105, 0.5);
}

.message.own-message {
  align-self: flex-end;
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.3);
}

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

.message-header strong {
  color: #3b82f6;
  font-size: 0.9rem;
}

.message.own-message .message-header strong {
  color: #22c55e;
}

.message-time {
  color: #64748b;
  font-size: 0.75rem;
}

.message-text {
  color: #e2e8f0;
  word-wrap: break-word;
}

.typing-indicator {
  padding: 8px 16px;
  color: #94a3b8;
  font-style: italic;
  font-size: 0.9rem;
}

.message-input-container {
  display: flex;
  gap: 10px;
}

.message-input-container input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.8);
  color: #f1f5f9;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.message-input-container input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Empty State */
.empty-state {
  text-align: center;
  color: #64748b;
  padding: 40px 20px;
  font-style: italic;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.modal-content {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.9));
  padding: 40px;
  border-radius: 20px;
  max-width: 600px;
  width: 90%;
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
  margin-bottom: 20px;
  color: #22c55e;
  text-align: center;
}

.modal-content p {
  margin-bottom: 25px;
  color: #94a3b8;
  text-align: center;
}

.session-details {
  background: rgba(15, 23, 42, 0.6);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 25px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.detail-item {
  margin-bottom: 15px;
}

.detail-item:last-child {
  margin-bottom: 0;
}

.detail-item strong {
  display: block;
  margin-bottom: 5px;
  color: #cbd5e1;
  font-size: 0.9rem;
}

.detail-item span {
  color: #3b82f6;
  font-family: monospace;
  font-size: 1rem;
}

.link-container {
  display: flex;
  gap: 10px;
}

.link-container input {
  flex: 1;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  color: #3b82f6;
  font-family: monospace;
  font-size: 0.9rem;
}

.copy-btn {
  padding: 10px 20px;
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.copy-btn:hover {
  background: rgba(59, 130, 246, 0.3);
}

.warning {
  color: #f59e0b;
  text-align: center;
  font-size: 0.9rem;
  margin-top: 20px;
}

.modal-content .btn-primary {
  width: 100%;
  margin-top: 10px;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1001;
}

.toast {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.9));
  color: #f1f5f9;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 10px;
  border-left: 4px solid #3b82f6;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  animation: slideInRight 0.3s ease;
  max-width: 350px;
  min-width: 250px;
}

.toast.success {
  border-left-color: #22c55e;
}

.toast.error {
  border-left-color: #ef4444;
}

.toast.warning {
  border-left-color: #f59e0b;
}

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

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

/* Footer */
footer {
  margin-top: auto;
  text-align: center;
  padding: 30px 0;
  color: #64748b;
  font-size: 0.9rem;
}

footer a {
  color: #3b82f6;
  text-decoration: none;
}

footer a:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }
  
  header h1 {
    font-size: 2rem;
    flex-direction: column;
    gap: 10px;
  }
  
  .section {
    padding: 20px;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .session-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .session-meta {
    flex-direction: column;
    gap: 5px;
  }
  
  .tabs {
    overflow-x: auto;
  }
  
  .file-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .file-actions {
    width: 100%;
  }
  
  .file-actions button {
    flex: 1;
  }
  
  .message {
    max-width: 85%;
  }
  
  .modal-content {
    padding: 25px;
  }
  
  .link-container {
    flex-direction: column;
  }
  
  #toast-container {
    left: 10px;
    right: 10px;
  }
  
  .toast {
    max-width: none;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.7rem;
  }
  
  .form-buttons {
    flex-direction: column;
  }
  
  .chat-container {
    height: 400px;
  }
}
