/* =====================================================
   TRADING INFOGRAPHIC AI — Frontend CSS
   Dark theme inspired by the layout reference
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --ti-bg:         #0d1117;
  --ti-surface:    #161b22;
  --ti-surface2:   #1c2333;
  --ti-border:     #30363d;
  --ti-accent:     #00d4ff;
  --ti-green:      #00e676;
  --ti-red:        #ff4d6d;
  --ti-orange:     #ff9f43;
  --ti-purple:     #bf5af2;
  --ti-text:       #e6edf3;
  --ti-muted:      #8b949e;
  --ti-radius:     12px;
  --ti-radius-lg:  20px;
}

/* ── BASE ─────────────────────────────────────────── */
.ti-wrapper {
  font-family: 'Inter', system-ui, sans-serif;
  background:  var(--ti-bg);
  min-height:  100vh;
  color:       var(--ti-text);
  padding:     40px 20px;
  box-sizing:  border-box;
}

.ti-wrapper *, .ti-wrapper *::before, .ti-wrapper *::after {
  box-sizing: border-box;
}

/* ── FORM SCREEN ──────────────────────────────────── */
.ti-form-screen {
  max-width: 680px;
  margin:    0 auto;
}

.ti-form-header {
  text-align:    center;
  margin-bottom: 40px;
}

.ti-form-logo {
  font-size:     48px;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 20px var(--ti-accent));
  animation: ti-pulse 2s ease-in-out infinite;
}

@keyframes ti-pulse {
  0%, 100% { filter: drop-shadow(0 0 20px var(--ti-accent)); }
  50%       { filter: drop-shadow(0 0 40px var(--ti-accent)); }
}

.ti-form-header h1 {
  font-size:     36px;
  font-weight:   900;
  color:         var(--ti-text);
  margin:        0 0 12px;
  letter-spacing: -1px;
}

.ti-accent { color: var(--ti-accent); }

.ti-form-header p {
  color:     var(--ti-muted);
  font-size: 15px;
  margin:    0;
}

/* ── DROPZONE ─────────────────────────────────────── */
.ti-dropzone {
  border:        2px dashed var(--ti-border);
  border-radius: var(--ti-radius-lg);
  background:    var(--ti-surface);
  padding:       48px 32px;
  text-align:    center;
  cursor:        pointer;
  transition:    all 0.25s ease;
  margin-bottom: 20px;
  position:      relative;
  overflow:      hidden;
}

.ti-dropzone::before {
  content:     '';
  position:    absolute;
  inset:       0;
  background:  radial-gradient(ellipse at center, rgba(0,212,255,0.04) 0%, transparent 70%);
  opacity:     0;
  transition:  opacity 0.3s;
}

.ti-dropzone:hover,
.ti-dropzone-active {
  border-color: var(--ti-accent);
  background:   rgba(0,212,255,0.04);
}

.ti-dropzone:hover::before,
.ti-dropzone-active::before {
  opacity: 1;
}

.ti-dropzone-icon {
  font-size:     40px;
  margin-bottom: 12px;
}

.ti-dropzone-title {
  font-size:   18px;
  font-weight: 700;
  color:       var(--ti-text);
  margin:      0 0 4px;
}

.ti-dropzone-sub {
  font-size: 14px;
  color:     var(--ti-muted);
  margin:    0 0 16px;
}

.ti-dropzone-types {
  display:       inline-block;
  background:    var(--ti-surface2);
  border:        1px solid var(--ti-border);
  border-radius: 20px;
  padding:       5px 16px;
  font-size:     12px;
  font-weight:   600;
  color:         var(--ti-accent);
  letter-spacing: 0.5px;
  margin:        0;
}

/* ── FILE PREVIEW ─────────────────────────────────── */
.ti-file-preview {
  background:    var(--ti-surface);
  border:        1px solid var(--ti-border);
  border-radius: var(--ti-radius);
  margin-bottom: 20px;
  overflow:      hidden;
}

.ti-file-preview-inner {
  display:     flex;
  align-items: center;
  padding:     16px 20px;
  gap:         14px;
}

.ti-file-icon { font-size: 28px; }

.ti-file-info {
  flex:        1;
  overflow:    hidden;
}

.ti-file-name {
  display:       block;
  font-size:     14px;
  font-weight:   600;
  color:         var(--ti-text);
  white-space:   nowrap;
  overflow:      hidden;
  text-overflow: ellipsis;
}

.ti-file-size {
  display:   block;
  font-size: 12px;
  color:     var(--ti-muted);
  margin-top: 2px;
}

.ti-file-remove {
  background:    none;
  border:        1px solid var(--ti-border);
  border-radius: 6px;
  color:         var(--ti-muted);
  cursor:        pointer;
  padding:       4px 10px;
  font-size:     14px;
  transition:    all 0.2s;
}

.ti-file-remove:hover {
  border-color: var(--ti-red);
  color:        var(--ti-red);
}

/* ── FIELD GROUP ──────────────────────────────────── */
.ti-field-group {
  margin-bottom: 20px;
  position:      relative;
}

.ti-label {
  display:       block;
  font-size:     13px;
  font-weight:   600;
  color:         var(--ti-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ti-label-optional {
  font-weight:    400;
  text-transform: none;
  letter-spacing: 0;
  color:          var(--ti-border);
  margin-left:    6px;
}

/* SELECT */
.ti-select-wrapper {
  position: relative;
}

.ti-select {
  width:         100%;
  background:    var(--ti-surface);
  border:        1px solid var(--ti-border);
  border-radius: var(--ti-radius);
  color:         var(--ti-text);
  font-family:   inherit;
  font-size:     15px;
  font-weight:   500;
  padding:       12px 44px 12px 16px;
  appearance:    none;
  cursor:        pointer;
  transition:    border-color 0.2s;
  outline:       none;
}

.ti-select:focus { border-color: var(--ti-accent); }

.ti-select-arrow {
  position:       absolute;
  right:          16px;
  top:            50%;
  transform:      translateY(-50%);
  color:          var(--ti-muted);
  pointer-events: none;
  font-size:      12px;
}

/* TEXTAREA */
.ti-textarea {
  width:         100%;
  background:    var(--ti-surface);
  border:        1px solid var(--ti-border);
  border-radius: var(--ti-radius);
  color:         var(--ti-text);
  font-family:   inherit;
  font-size:     14px;
  padding:       14px 16px;
  resize:        vertical;
  min-height:    90px;
  outline:       none;
  transition:    border-color 0.2s;
}

.ti-textarea:focus { border-color: var(--ti-accent); }

.ti-textarea::placeholder { color: var(--ti-border); }

.ti-char-count {
  position:   absolute;
  bottom:     10px;
  right:      12px;
  font-size:  11px;
  color:      var(--ti-border);
}

/* ── SUBMIT BUTTON ────────────────────────────────── */
.ti-btn-submit {
  width:         100%;
  position:      relative;
  background:    linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
  border:        none;
  border-radius: var(--ti-radius);
  color:         #000;
  font-family:   inherit;
  font-size:     16px;
  font-weight:   800;
  padding:       16px 24px;
  cursor:        pointer;
  overflow:      hidden;
  transition:    all 0.3s;
  margin-top:    8px;
  letter-spacing: 0.3px;
}

.ti-btn-submit:disabled {
  opacity: 0.35;
  cursor:  not-allowed;
}

.ti-btn-submit:not(:disabled):hover {
  transform:  translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,212,255,0.35);
}

.ti-btn-submit:not(:disabled):active {
  transform: translateY(0);
}

.ti-btn-shine {
  position:   absolute;
  top:        -50%;
  left:       -100%;
  width:      60%;
  height:     200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transform:  skewX(-20deg);
  animation:  ti-shine 3s infinite;
}

@keyframes ti-shine {
  0%   { left: -100%; }
  50%  { left: 150%; }
  100% { left: 150%; }
}

.ti-disclaimer {
  font-size:  12px;
  color:      var(--ti-border);
  text-align: center;
  margin-top: 14px;
}

/* ── LOADING SCREEN ───────────────────────────────── */
.ti-loading-screen {
  max-width:     500px;
  margin:        60px auto;
  text-align:    center;
  padding:       40px 20px;
}

.ti-loading-inner { animation: ti-fadeIn 0.5s ease; }

@keyframes ti-fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ORB */
.ti-loading-orb {
  position: relative;
  width:    100px;
  height:   100px;
  margin:   0 auto 32px;
}

.ti-orb-core {
  position:    absolute;
  inset:       0;
  display:     flex;
  align-items: center;
  justify-content: center;
  font-size:   32px;
  filter:      drop-shadow(0 0 16px var(--ti-accent));
  animation:   ti-pulse 1.5s ease-in-out infinite;
}

.ti-orb-ring {
  position:     absolute;
  border-radius: 50%;
  border:        2px solid transparent;
  animation:    ti-spin linear infinite;
}

.ti-orb-ring-1 {
  inset:        8px;
  border-color: var(--ti-accent) transparent transparent transparent;
  animation-duration: 1.8s;
}

.ti-orb-ring-2 {
  inset:        0;
  border-color: transparent var(--ti-purple) transparent transparent;
  animation-duration: 2.4s;
  animation-direction: reverse;
}

.ti-orb-ring-3 {
  inset:        16px;
  border-color: transparent transparent var(--ti-green) transparent;
  animation-duration: 3.2s;
}

@keyframes ti-spin {
  to { transform: rotate(360deg); }
}

.ti-loading-title {
  font-size:   26px;
  font-weight: 800;
  color:       var(--ti-text);
  margin:      0 0 8px;
}

.ti-loading-subtitle {
  color:         var(--ti-muted);
  font-size:     14px;
  min-height:    20px;
  margin-bottom: 32px;
  transition:    all 0.3s;
}

/* STEPS */
.ti-loading-steps {
  display:        flex;
  flex-direction: column;
  gap:            12px;
  margin-bottom:  28px;
  text-align:     left;
  max-width:      300px;
  margin-left:    auto;
  margin-right:   auto;
}

.ti-step {
  display:     flex;
  align-items: center;
  gap:         12px;
  color:       var(--ti-muted);
  font-size:   13px;
  font-weight: 500;
  opacity:     0.4;
  transition:  all 0.4s;
}

.ti-step-active {
  color:   var(--ti-text);
  opacity: 1;
}

.ti-step-done {
  color:   var(--ti-green);
  opacity: 0.7;
}

.ti-step-dot {
  width:         10px;
  height:        10px;
  border-radius: 50%;
  border:        2px solid currentColor;
  flex-shrink:   0;
  transition:    all 0.3s;
}

.ti-step-active .ti-step-dot {
  background: var(--ti-accent);
  border-color: var(--ti-accent);
  box-shadow: 0 0 8px var(--ti-accent);
  animation: ti-pulse-dot 1s ease-in-out infinite;
}

.ti-step-done .ti-step-dot {
  background:  var(--ti-green);
  border-color: var(--ti-green);
}

@keyframes ti-pulse-dot {
  0%, 100% { box-shadow: 0 0 4px var(--ti-accent); }
  50%       { box-shadow: 0 0 14px var(--ti-accent); }
}

/* PROGRESS BAR */
.ti-loading-bar-wrapper {
  background:    var(--ti-surface2);
  border-radius: 8px;
  height:        6px;
  overflow:      hidden;
}

.ti-loading-bar {
  height:     100%;
  width:      5%;
  background: linear-gradient(90deg, var(--ti-accent), var(--ti-purple));
  border-radius: 8px;
  transition: width 1.2s ease;
  box-shadow: 0 0 10px var(--ti-accent);
}

/* ── ERROR SCREEN ─────────────────────────────────── */
.ti-error-screen {
  max-width:  480px;
  margin:     60px auto;
  text-align: center;
  padding:    40px;
  background: var(--ti-surface);
  border:     1px solid rgba(255,77,109,0.3);
  border-radius: var(--ti-radius-lg);
  animation:  ti-fadeIn 0.4s ease;
}

.ti-error-icon { font-size: 48px; margin-bottom: 16px; }

.ti-error-screen h2 {
  font-size:   22px;
  font-weight: 800;
  margin:      0 0 12px;
}

.ti-error-screen p {
  color:         var(--ti-muted);
  font-size:     14px;
  margin-bottom: 24px;
}

.ti-btn-retry {
  background:    linear-gradient(135deg, var(--ti-red), #cc0033);
  border:        none;
  border-radius: var(--ti-radius);
  color:         #fff;
  font-family:   inherit;
  font-size:     14px;
  font-weight:   700;
  padding:       12px 28px;
  cursor:        pointer;
  transition:    all 0.2s;
}

.ti-btn-retry:hover {
  transform:  translateY(-2px);
  box-shadow: 0 6px 20px rgba(255,77,109,0.4);
}

/* ── RESPONSIVE ───────────────────────────────────── */
@media (max-width: 600px) {
  .ti-wrapper { padding: 20px 12px; }
  .ti-form-header h1 { font-size: 26px; }
  .ti-dropzone { padding: 32px 16px; }
}

/* =====================================================
   TRADING INFOGRAPHIC AI — Dashboard SaaS
   ===================================================== */

/* ── LAYOUT GERAL ─────────────────────────────────── */
body.ti-dashboard-page {
  background: #0d1117 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden;
}

body.ti-dashboard-page .site-header,
body.ti-dashboard-page header.wp-block-template-part,
body.ti-dashboard-page .site-footer,
body.ti-dashboard-page footer.wp-block-template-part {
  display: none !important;
}

body.ti-dashboard-page .wp-site-blocks,
body.ti-dashboard-page .site,
body.ti-dashboard-page main,
body.ti-dashboard-page #primary,
body.ti-dashboard-page #content,
body.ti-dashboard-page .entry-content,
body.ti-dashboard-page article {
  padding: 0 !important;
  margin: 0 !important;
  max-width: 100% !important;
  background: transparent !important;
}

/* ── CONTAINER PRINCIPAL ──────────────────────────── */
.ti-dash {
  display: flex;
  min-height: 100vh;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--ti-bg);
  color: var(--ti-text);
}

/* ── SIDEBAR ──────────────────────────────────────── */
.ti-sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--ti-surface);
  border-right: 1px solid var(--ti-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.25s ease;
}

.ti-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--ti-border);
}

.ti-sidebar-brand-icon {
  font-size: 22px;
  filter: drop-shadow(0 0 8px var(--ti-accent));
}

.ti-sidebar-brand-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--ti-text);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.ti-sidebar-brand-name span {
  color: var(--ti-accent);
}

/* ── NAV ──────────────────────────────────────────── */
.ti-sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ti-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ti-muted);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.ti-nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--ti-text);
}

.ti-nav-item.active {
  background: rgba(0,212,255,0.1);
  color: var(--ti-accent);
}

.ti-nav-item.active .ti-nav-icon {
  filter: drop-shadow(0 0 6px var(--ti-accent));
}

.ti-nav-icon {
  font-size: 17px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.ti-nav-badge {
  margin-left: auto;
  background: var(--ti-accent);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  line-height: 1.4;
}

/* ── SIDEBAR FOOTER ───────────────────────────────── */
.ti-sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--ti-border);
  font-size: 11px;
  color: var(--ti-border);
}

/* ── MAIN CONTENT ─────────────────────────────────── */
.ti-dash-main {
  margin-left: 240px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── TOPBAR ───────────────────────────────────────── */
.ti-topbar {
  height: 60px;
  border-bottom: 1px solid var(--ti-border);
  background: var(--ti-surface);
  display: flex;
  align-items: center;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 12px;
}

.ti-topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ti-text);
  margin: 0;
}

.ti-topbar-divider {
  color: var(--ti-border);
  font-size: 14px;
}

.ti-topbar-sub {
  font-size: 13px;
  color: var(--ti-muted);
}

/* ── SEÇÕES ───────────────────────────────────────── */
.ti-section {
  display: none;
  padding: 32px 28px;
  flex: 1;
}

.ti-section.ti-section-active {
  display: block;
}

/* ── PAINEL — STATS ───────────────────────────────── */
.ti-dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.ti-dash-stat-card {
  background: var(--ti-surface);
  border: 1px solid var(--ti-border);
  border-radius: var(--ti-radius);
  padding: 20px;
  transition: border-color 0.2s;
}

.ti-dash-stat-card:hover {
  border-color: var(--ti-accent);
}

.ti-dash-stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ti-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.ti-dash-stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--ti-text);
  line-height: 1;
  margin-bottom: 4px;
}

.ti-dash-stat-sub {
  font-size: 12px;
  color: var(--ti-muted);
}

/* ── PAINEL — RECENTES ────────────────────────────── */
.ti-dash-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ti-text);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ti-dash-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ti-border);
  margin-left: 8px;
}

.ti-recent-table-wrap {
  background: var(--ti-surface);
  border: 1px solid var(--ti-border);
  border-radius: var(--ti-radius);
  overflow: hidden;
}

.ti-recent-table {
  width: 100%;
  border-collapse: collapse;
}

.ti-recent-table thead th {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ti-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  border-bottom: 1px solid var(--ti-border);
  background: var(--ti-surface2);
}

.ti-recent-table tbody tr {
  border-bottom: 1px solid var(--ti-border);
  transition: background 0.15s;
}

.ti-recent-table tbody tr:last-child {
  border-bottom: none;
}

.ti-recent-table tbody tr:hover {
  background: rgba(255,255,255,0.025);
}

.ti-recent-table td {
  padding: 13px 16px;
  font-size: 13px;
  color: var(--ti-text);
}

.ti-recent-table td.ti-td-muted {
  color: var(--ti-muted);
}

.ti-recent-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--ti-muted);
  font-size: 14px;
}

.ti-recent-empty p { margin: 8px 0 20px; }

.ti-recent-link {
  color: var(--ti-accent);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border: 1px solid var(--ti-accent);
  border-radius: 6px;
  transition: all 0.2s;
  display: inline-block;
}

.ti-recent-link:hover {
  background: rgba(0,212,255,0.1);
}

.ti-recent-market-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--ti-surface2);
  border: 1px solid var(--ti-border);
  color: var(--ti-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ── WELCOME BANNER ───────────────────────────────── */
.ti-dash-welcome {
  background: linear-gradient(135deg, rgba(0,212,255,0.08) 0%, rgba(191,90,242,0.06) 100%);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: var(--ti-radius-lg);
  padding: 28px 32px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.ti-dash-welcome-icon {
  font-size: 40px;
  filter: drop-shadow(0 0 16px var(--ti-accent));
}

.ti-dash-welcome h2 {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 4px;
  color: var(--ti-text);
}

.ti-dash-welcome p {
  margin: 0;
  font-size: 14px;
  color: var(--ti-muted);
}

/* ── IMPORTAR — WRAPPER ───────────────────────────── */
.ti-section-importar .ti-wrapper {
  padding: 0;
  min-height: unset;
}

.ti-section-importar .ti-form-screen {
  max-width: 640px;
}

/* ── BTN IMPORTAR (atalho no painel) ──────────────── */
.ti-dash-import-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
  border: none;
  border-radius: var(--ti-radius);
  color: #000;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.ti-dash-import-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,212,255,0.3);
  color: #000;
}

/* ── MOBILE SIDEBAR TOGGLE ────────────────────────── */
.ti-sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 200;
  background: var(--ti-surface);
  border: 1px solid var(--ti-border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 16px;
  cursor: pointer;
  color: var(--ti-text);
}

@media (max-width: 768px) {
  .ti-sidebar {
    transform: translateX(-100%);
  }
  .ti-sidebar.ti-sidebar-open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,0.5);
  }
  .ti-dash-main {
    margin-left: 0;
  }
  .ti-sidebar-toggle {
    display: block;
  }
  .ti-topbar {
    padding-left: 56px;
  }
  .ti-section {
    padding: 20px 16px;
  }
  .ti-dash-stats {
    grid-template-columns: 1fr 1fr;
  }
  .ti-dash-welcome {
    flex-direction: column;
    text-align: center;
    padding: 20px;
  }
}
