@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #00cb0e;
  --primary-dark: #003d04;
  --secondary: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #06b6d4;
  
  --bg-primary: #0a1a0a;
  --bg-secondary: #1a2e1a;
  --bg-tertiary: #2a4a2a;
  
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  --border: #2a4a2a;
  --shadow: rgba(0, 0, 0, 0.3);
  
  --radius: 16px;
  --radius-lg: 20px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #0a1a0a 0%, #1a2e1a 100%);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

/* Header */
.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.logo img {
  height: 32px;
  width: auto;
}

.header-right {
  display: flex;
  align-items: center;
}

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

.header-time {
  color: var(--text-secondary);
  font-size: 0.875rem;
  white-space: nowrap;
}

.btn-logout {
  min-width: 70px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Welcome Banner */
.welcome-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
}

.welcome-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.welcome-text p {
  margin: 0;
}

.welcome-subtitle {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.25rem;
  font-size: 0.9rem;
  opacity: 0.95;
}

/* Tabs */
.tabs {
  max-width: 1400px;
  margin: 0 auto 2rem;
  padding: 0 2rem;
  display: flex;
  gap: 1rem;
  border-bottom: 2px solid var(--border);
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.3s;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

/* Grid */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 1024px) {
  .grid-2col {
    grid-template-columns: 1fr;
  }
}

/* Card */
.card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 4px 6px var(--shadow);
  border: 1px solid var(--border);
}

.card h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.card-subtitle {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* Form */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 203, 14, 0.1);
}

.input-with-btn {
  display: flex;
  gap: 0.5rem;
}

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

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  transition: all 0.3s;
  position: relative;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropzone.dragover {
  border-color: var(--primary);
  background: rgba(0, 203, 14, 0.05);
}

.dropzone-content {
  width: 100%;
}

.dropzone-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  color: var(--text-muted);
}

.dropzone-text {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.dropzone-subtext {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.dropzone-info {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 1rem;
}

.dropzone-preview {
  width: 100%;
  height: 100%;
  position: relative;
}

.dropzone-preview img {
  max-width: 100%;
  max-height: 400px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.btn-remove {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--danger);
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.btn-remove:hover {
  transform: scale(1.1);
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

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

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 203, 14, 0.4);
}

.btn-secondary {
  background: #00cb0e;
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: #3a5a3a;
}

.btn-block {
  width: 100%;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
}

.badge-primary {
  background: var(--primary);
  color: white;
}

.badge-success {
  background: var(--success);
  color: white;
}

.badge-info {
  background: var(--info);
  color: white;
}

.badge-warning {
  background: var(--warning);
  color: white;
}

/* Tips Section */
.tips-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.tips-section h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.tips-list {
  list-style: none;
}

.tips-list li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.tips-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: bold;
}

/* Result States */
.placeholder-content,
.loading-content {
  text-align: center;
  padding: 4rem 2rem;
}

.placeholder-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
  color: var(--text-muted);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

.loading-text {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Result Content */
.result-header {
  margin-bottom: 2rem;
}

.result-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.result-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.price-display {
  color: var(--text-secondary);
}

.price-display strong {
  color: var(--success);
  font-size: 1.25rem;
}

.section-title {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Operations */
.operations-grid {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.operation-card {
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.operation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.operation-name {
  font-weight: 600;
  font-size: 1.1rem;
}

.confidence-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.confidence-bar {
  width: 60px;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  background: var(--success);
  transition: width 0.3s;
}

.operation-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-value {
  font-weight: 500;
}

.detail-value.action-buy {
  color: var(--success);
}

.detail-value.action-sell {
  color: var(--danger);
}

.operation-rationale {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.operation-rationale p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.operation-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

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

/* Result Actions */
.result-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

/* History Table */
.table-responsive {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
}

.history-table th,
.history-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.history-table th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.history-table td {
  color: var(--text-primary);
}

.history-table tr:hover {
  background: var(--bg-tertiary);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.pagination button {
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s;
}

.pagination button:hover:not(:disabled) {
  background: var(--primary);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination button.active {
  background: var(--primary);
}

/* Footer */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 4rem;
}

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

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.7;
}

.footer-logo img {
  height: 24px;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--primary);
}

/* Tab Content */
.tab-content {
  display: none;
}

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

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px var(--shadow);
  border: 1px solid var(--border);
  transform: translateY(200%);
  transition: transform 0.3s;
  z-index: 1000;
  max-width: 400px;
}

.toast.show {
  transform: translateY(0);
}

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

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

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

/* Login Page */
.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 100vh;
  padding: 2rem;
}

.login-logo-top {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-top {
  height: 50px;
  margin-bottom: 1rem;
}

.login-logo-top h1 {
  font-size: 2rem;
  margin: 0;
  color: var(--text-primary);
}

.login-container {
  width: 100%;
  max-width: 450px;
  flex: 1;
  display: flex;
  align-items: center;
}

.login-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 3rem;
  box-shadow: 0 8px 24px var(--shadow);
  border: 1px solid var(--border);
  width: 100%;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-large {
  height: 64px;
  margin-bottom: 1rem;
}

.login-header h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.footer-login {
  width: 100%;
  text-align: center;
  padding: 2rem 0 1rem;
}

.footer-login .footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.footer-login .footer-logo {
  height: 40px;
  width: auto;
}

.auth-form h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
}

.auth-links a {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s;
}

.auth-links a:hover {
  color: var(--primary-dark);
}

/* Responsive */
@media (max-width: 768px) {
  .header-content,
  .welcome-content,
  .tabs,
  .container,
  .footer-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .card {
    padding: 1.5rem;
  }

  .operation-details {
    grid-template-columns: 1fr;
  }

  .footer-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .footer-links {
    flex-direction: column;
    gap: 0.5rem;
  }

  .toast {
    left: 1rem;
    right: 1rem;
  }

  /* Header mobile - ajustar data e hora */
  .header-content {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .logo {
    flex: 1 1 auto;
  }

  .header-right {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
  }

  .header-time {
    font-size: 0.75rem;
    text-align: right;
    line-height: 1.2;
    white-space: nowrap;
  }

  /* Select de ativo maior no mobile */
  #assetSelect {
    font-size: 16px !important;
    padding: 0.875rem !important;
    min-height: 48px;
  }

  /* Outros inputs também maiores */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Grid de 1 coluna no mobile */
  .grid-2col {
    grid-template-columns: 1fr;
  }

  /* Logo menor no mobile */
  .header-logo {
    height: 35px;
  }
}

/* Chat IA Crypto */
.crypto-tickers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
}

.ticker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.ticker-icon {
  font-size: 1.5rem;
}

.ticker-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.ticker-price {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.ticker-change {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.ticker-change.positive {
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.ticker-change.negative {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 600px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-message {
  display: flex;
  gap: 1rem;
  animation: slideIn 0.3s ease;
}

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

.chat-message.user-message {
  flex-direction: row-reverse;
}

.message-avatar {
  display: none;
}

.message-content {
  flex: 1;
  background: var(--bg-tertiary);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  max-width: 85%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-message .message-content {
  background: var(--primary);
}

.message-content p {
  margin: 0 0 0.5rem 0;
  line-height: 1.6;
}

.message-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chat-input-container {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border);
}

.chat-input {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9375rem;
  resize: none;
  transition: border-color 0.2s;
}

.chat-input:focus {
  outline: none;
  border-color: var(--primary);
}

.chat-input::placeholder {
  color: var(--text-muted);
}

/* Responsividade */
@media (max-width: 768px) {
  .crypto-tickers {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .chat-container {
    height: 500px;
  }
  
  .message-content {
    max-width: 85%;
  }
  
  .chat-input-container {
    flex-direction: column;
  }
}

/* Header ajustado com horário */
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-time {
  font-size: 0.9rem;
  color: #94a3b8;
  font-weight: 500;
}

/* Rodapé simplificado */
.footer-content {
  text-align: center;
}

.footer-content p {
  margin: 0;
  color: #94a3b8;
  font-size: 0.9rem;
}

/* Header ajustado com horário */
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-time {
  font-size: 0.9rem;
  color: #94a3b8;
  font-weight: 500;
}

/* Rodapé simplificado */
.footer-content {
  text-align: center;
}

.footer-content p {
  margin: 0;
  color: #94a3b8;
  font-size: 0.9rem;
}

/* Logo do rodapé */
.footer-logo {
  height: 40px;
  width: auto;
  margin-bottom: 0.5rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Centralizar rodapé */
.footer {
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Logo do header */
.header-logo {
  height: 50px;
  width: auto;
  display: block;
}

.logo {
  display: flex;
  align-items: center;
}

/* Crypto Prices Section */
.crypto-prices-section {
  background: var(--bg-primary);
  padding: 2rem 0;
  margin-bottom: 2rem;
}

.crypto-prices-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.crypto-price-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--border);
  transition: all 0.3s;
  cursor: pointer;
}

.crypto-price-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px var(--shadow);
  border-color: var(--primary);
}

.crypto-icon {
  font-size: 2.5rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.crypto-icon-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.crypto-info {
  flex: 1;
}

.crypto-symbol {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.crypto-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.crypto-change {
  font-size: 0.875rem;
  font-weight: 600;
}

.crypto-change.positive {
  color: var(--success);
}

.crypto-change.negative {
  color: var(--danger);
}

@media (max-width: 768px) {
  .crypto-prices-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .crypto-price-card {
    padding: 1rem;
  }

  .crypto-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
  }

  .crypto-price {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .crypto-prices-container {
    grid-template-columns: 1fr;
  }
}
