/* ============================================
   MRCRUZ FX TRADING TOOLKIT - DESIGN SYSTEM
   Paleta Profissional Dark Mode
   ============================================ */

/* === CSS Variables (Design Tokens) === */
:root {
  /* Background Colors */
  --bg-primary: #0a0f1a;
  --bg-secondary: #111827;
  --bg-tertiary: #1e293b;
  --bg-card: #151d2e;
  --bg-card-hover: #1a2438;
  
  /* Surface Colors (para cards internos / inputs) */
  --surface-light: #f8fafc;
  --surface-muted: #e2e8f0;
  
  /* Text Colors */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dark: #1e293b;
  
  /* Brand / Accent Colors */
  --accent-primary: #10b981;
  --accent-primary-hover: #059669;
  --accent-secondary: #3b82f6;
  --accent-secondary-hover: #2563eb;
  
  /* Semantic Colors */
  --color-success: #22c55e;
  --color-success-bg: rgba(34, 197, 94, 0.12);
  --color-error: #ef4444;
  --color-error-bg: rgba(239, 68, 68, 0.12);
  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.12);
  --color-info: #3b82f6;
  --color-info-bg: rgba(59, 130, 246, 0.12);
  --color-neutral: #6b7280;
  --color-neutral-bg: rgba(107, 114, 128, 0.15);
  
  /* Border Colors */
  --border-primary: #1e293b;
  --border-secondary: #334155;
  --border-accent: var(--accent-primary);
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.6);
  
  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

/* === Reset & Base === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === App Shell === */
.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  min-height: 100vh;
}

/* === Header === */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.app-title-badge {
  background: linear-gradient(135deg, var(--accent-primary), #059669);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  margin-right: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.app-title-main {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* === Tab Navigation === */
.tab-buttons {
  display: flex;
  gap: 6px;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-primary);
}

.tab-btn {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

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

.tab-btn-active {
  background: var(--accent-primary);
  color: #fff;
}

.tab-btn-active:hover {
  background: var(--accent-primary-hover);
  color: #fff;
}

/* === Page Header === */
.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.page-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* === Cards === */
.card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
  transition: var(--transition-normal);
}

.card:hover {
  border-color: var(--border-secondary);
}

.card-content {
  padding: 20px;
}

/* Card Light - para formulários e áreas de checklist */
.card-light {
  background: var(--bg-card);
  border-color: var(--border-primary);
}

.card-light .card-content {
  color: var(--text-primary);
}

/* === Grid Layouts === */
.grid-2 {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
}

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

/* === Section Headers === */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.section-subtotal {
  font-size: 13px;
  color: var(--text-secondary);
}

/* === Checklist Item Rows === */
.item-row {
  display: grid;
  grid-template-columns: 7fr 2fr 3fr;
  gap: 10px;
  align-items: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-secondary);
  padding: 12px 14px;
  margin-bottom: 8px;
  background: var(--bg-tertiary);
  transition: var(--transition-fast);
}

.item-row:hover {
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
}

.item-label {
  font-size: 13px;
  color: var(--text-primary);
}

.item-weight {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* === Form Elements === */
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-secondary);
  padding: 10px 12px;
  font-size: 14px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transition: var(--transition-fast);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

.label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
  display: block;
}

/* === Buttons === */
.btn-small {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-secondary);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-small:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn-small.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
}

.btn-small.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #dc2626;
  color: #dc2626;
}

.btn-primary {
  width: 100%;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-hover));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  margin-top: 12px;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--accent-secondary);
  background: transparent;
  color: var(--accent-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--accent-secondary);
  color: #fff;
}

.btn-outline {
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-secondary);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-outline:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

/* === Score Box === */
.score-box {
  text-align: center;
  padding: 16px 0;
}

.score-value {
  font-size: 48px;
  font-weight: 800;
  transition: color 0.3s ease;
}

.score-headline {
  font-size: 15px;
  font-weight: 600;
  margin-top: 6px;
}

/* === Progress Bar === */
.progress-wrapper {
  margin-top: 16px;
  width: 100%;
  height: 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), #34d399);
  border-radius: var(--radius-full);
  transition: width 0.3s ease-out;
}

/* === Two Column Layout === */
.two-col {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 20px;
  align-items: flex-start;
}

.two-col > div:first-child {
  flex: 1;
  min-width: 280px;
}

.two-col > div:last-child {
  flex-shrink: 0;
}

@media (max-width: 800px) {
  .two-col {
    flex-direction: column;
  }
  
  .two-col > div:first-child,
  .two-col > div:last-child {
    width: 100%;
  }
}

/* === Result Tags === */
.tag-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-win {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.tag-loss {
  background: var(--color-error-bg);
  color: var(--color-error);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.tag-be {
  background: var(--color-neutral-bg);
  color: var(--text-secondary);
  border: 1px solid rgba(107, 114, 128, 0.3);
}

.tag-open {
  background: var(--color-info-bg);
  color: var(--accent-secondary);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* === History Grid === */
.history-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.history-row {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-primary);
}

.history-row:last-child {
  border-bottom: none;
}

/* === Stats Grid === */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

/* === Home & Coach Layouts === */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
}

/* === Account Pills === */
.accounts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.account-pill {
  width: 100%;
  text-align: left;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  border: 1px solid var(--border-primary);
  background: var(--bg-tertiary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.account-pill:hover {
  border-color: var(--border-secondary);
  background: var(--bg-card-hover);
}

.account-pill-active {
  border-color: var(--accent-primary);
  background: rgba(16, 185, 129, 0.08);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.account-pill-main {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.account-pill-balance {
  color: var(--color-success);
  font-weight: 700;
  font-size: 15px;
}

.account-pill-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.account-delete-btn {
  background: rgba(239, 68, 68, 0.15) !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  color: #ef4444 !important;
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
}

.account-delete-btn:hover {
  background: rgba(239, 68, 68, 0.3) !important;
  border-color: rgba(239, 68, 68, 0.6) !important;
  transform: scale(1.05);
}

/* Create Account Form */
.create-account-form input,
.create-account-form select {
  transition: var(--transition-fast);
}

.create-account-form input:focus,
.create-account-form select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.create-account-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* User Welcome Card */
.user-welcome-card {
  transition: var(--transition-fast);
}

.user-welcome-card:hover {
  border-color: var(--accent-primary);
}

.user-welcome-card button:hover {
  transform: translateY(-1px);
}

/* Password Change Modal */
.password-modal-overlay {
  backdrop-filter: blur(4px);
}

/* === News & Events Lists === */
.news-list,
.events-list {
  list-style: none;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.news-item,
.event-item {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
  padding: 14px 16px;
  background: var(--bg-tertiary);
  transition: var(--transition-fast);
}

.news-item-clickable,
.event-item-clickable {
  cursor: pointer;
}

.news-item-clickable:hover {
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(96, 165, 250, 0.05);
  transform: translateX(4px);
}

.event-item-clickable:hover {
  border-color: rgba(167, 139, 250, 0.4);
  background: rgba(167, 139, 250, 0.05);
  transform: translateX(4px);
}

.news-item:hover,
.event-item:hover {
  border-color: var(--border-secondary);
}

.news-item h3,
.event-item h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.news-date,
.event-date {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

/* === Coach Grid === */
.coach-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

@media (max-width: 900px) {
  .coach-grid {
    grid-template-columns: 1fr;
  }
}

.coach-block {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
  padding: 16px;
  background: var(--bg-tertiary);
}

.coach-block h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 12px;
}

.coach-block ul {
  padding-left: 0;
  list-style: none;
}

.coach-block li {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 0;
  border-bottom: 1px solid var(--border-primary);
}

.coach-block li:last-child {
  border-bottom: none;
}

/* === Info Boxes (Interpretation & Session) === */
.checklist-interpretation-box,
.checklist-session-box,
.checklist-info-box {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid var(--border-secondary);
  width: fit-content;
  max-width: 100%;
}

.checklist-interpretation-box *,
.checklist-session-box *,
.checklist-info-box * {
  color: var(--text-primary);
}

.checklist-interpretation-box ul,
.checklist-session-box ul {
  padding-left: 16px;
  margin: 6px 0;
}

.checklist-interpretation-box li,
.checklist-session-box li {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 2px 0;
}

.checklist-interpretation-box strong,
.checklist-session-box strong {
  color: var(--accent-primary);
}

.checklist-interpretation-box p,
.checklist-session-box p {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 4px 0;
  line-height: 1.4;
}

/* === Risk Input Section === */
.risk-input-section {
  margin-top: 12px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
}

.risk-input-section .label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.risk-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.risk-col .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.risk-col input[type="number"] {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  font-family: 'Inter', monospace;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-secondary);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transition: var(--transition-fast);
}

.risk-col input[type="number"]:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.risk-col input[type="number"]::placeholder {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 400;
}

.risk-mode-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-primary);
}

.risk-mode-options {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.risk-mode-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-primary);
  transition: var(--transition-fast);
}

.risk-mode-options label:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.risk-mode-options input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
}

.risk-mode-options input[type="radio"]:checked + span,
.risk-mode-options label:has(input:checked) {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: rgba(16, 185, 129, 0.1);
}

.risk-value-input {
  margin-top: 12px;
}

.risk-value-input input[type="number"] {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-secondary);
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.risk-value-input input[type="number"]:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.risk-summary {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-primary);
}

.risk-summary-text {
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 480px) {
  .risk-mode-options {
    flex-direction: column;
    gap: 8px;
  }
  
  .risk-mode-options label {
    justify-content: center;
  }
}

/* === Login Screen === */
.login-screen {
  background: var(--bg-primary);
}

.login-screen h1 {
  color: var(--text-primary);
}

.login-screen p {
  color: var(--text-secondary);
}

.login-screen .card {
  background: var(--bg-card);
  border-color: var(--border-primary);
}

.login-screen label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  display: block;
  margin-bottom: 6px;
}

.login-screen input,
.login-screen select {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  color: var(--text-primary);
}

.login-screen input:focus,
.login-screen select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.login-screen .btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-hover));
  color: #fff;
}

.login-screen a {
  color: var(--accent-secondary);
  text-decoration: none;
}

.login-screen a:hover {
  text-decoration: underline;
}

.login-screen .help-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* === Form Groups === */
.form-vertical {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* === Calendar Styles === */
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 6px;
}

.calendar-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Calendar Weekday Headers */
.calendar-weekday-header {
  font-size: 11px;
  font-weight: 600;
  padding: 8px;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  color: var(--text-muted);
}

/* Calendar Day Cells */
.dashboard-grid-day,
.calendar-day {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
  padding: 8px;
  background: var(--bg-tertiary);
  min-height: 80px;
  height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition-fast);
}

.dashboard-grid-day:hover,
.calendar-day:hover {
  border-color: var(--accent-primary);
}

.dashboard-grid-day *,
.calendar-day * {
  color: var(--text-primary);
}

/* Calendar day with positive P/L */
.calendar-day-positive {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.4);
}

/* Calendar day with negative P/L */
.calendar-day-negative {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
}

/* Calendar day neutral (breakeven or no trades) */
.calendar-day-neutral {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.4);
}

/* Calendar week summary column */
.calendar-week-summary {
  border-radius: var(--radius-md);
  border: 1px solid rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.08);
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 80px;
  height: 80px;
}

.calendar-week-summary-positive {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
}

.calendar-week-summary-negative {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

/* === Stats Cards === */
.stats-box,
.stats-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.stats-box *,
.stats-card * {
  color: var(--text-primary);
}

/* === Text Utilities === */
.text-sm {
  font-size: 13px;
  color: var(--text-secondary);
}

.text-xs {
  font-size: 12px;
  color: var(--text-muted);
}

/* === Footer === */
.footer {
  margin-top: 32px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 20px;
  border-top: 1px solid var(--border-primary);
}

/* === Scrollbar Styling === */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-secondary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* === Modal Overlay === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 26, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: 24px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-xl);
}

.modal-content h2,
.modal-content h3 {
  color: var(--text-primary);
}

.modal-content p {
  color: var(--text-secondary);
}

/* === Responsive Adjustments === */
@media (max-width: 768px) {
  .app-shell {
    padding: 16px 12px 32px;
  }
  
  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .tab-buttons {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }
  
  .page-header h1 {
    font-size: 22px;
  }
  
  .score-value {
    font-size: 36px;
  }
  
  .item-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .history-grid {
    grid-template-columns: 1fr;
  }
  
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .tab-buttons {
    gap: 4px;
    padding: 3px;
  }
  
  .tab-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
  
  .stat-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   FORUM STYLES
   ============================================ */

.forum-container {
  max-width: 1000px;
  margin: 0 auto;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-success {
  background: var(--color-success);
  color: white;
  border: none;
  cursor: pointer;
}

.btn-success:hover {
  background: #1ea34b;
}

.btn-danger {
  background: var(--color-danger);
  color: white;
  border: none;
  cursor: pointer;
}

.btn-danger:hover {
  background: #dc2626;
}

/* Lightbox for Forum Images */
.forum-lightbox {
  animation: lightboxFadeIn 0.2s ease;
}

.forum-lightbox img {
  animation: lightboxZoomIn 0.2s ease;
}

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

@keyframes lightboxZoomIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ===== Modal / Pop-up Animations ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: modalOverlayIn 0.3s ease;
}

.modal-content {
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  border-radius: 20px;
  padding: 28px;
  width: 100%;
  max-width: 420px;
  border: 1px solid rgba(51, 65, 85, 0.6);
  box-shadow: 
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 20px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 100px -20px rgba(59, 130, 246, 0.15);
  animation: modalContentIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center center;
}

.modal-content-lg {
  max-width: 600px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(51, 65, 85, 0.5);
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  transform: rotate(90deg);
}

.modal-body {
  margin-bottom: 20px;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

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

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

/* Toast / Notification Animations */
.toast-notification {
  position: fixed;
  top: 24px;
  right: 24px;
  padding: 16px 24px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid #334155;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
  z-index: 2000;
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
}

.toast-notification.toast-success {
  border-color: rgba(34, 197, 94, 0.4);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, #0f172a 100%);
}

.toast-notification.toast-error {
  border-color: rgba(239, 68, 68, 0.4);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, #0f172a 100%);
}

.toast-notification.toast-info {
  border-color: rgba(59, 130, 246, 0.4);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, #0f172a 100%);
}

.toast-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.toast-success .toast-icon {
  background: rgba(34, 197, 94, 0.2);
}

.toast-error .toast-icon {
  background: rgba(239, 68, 68, 0.2);
}

.toast-info .toast-icon {
  background: rgba(59, 130, 246, 0.2);
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 14px;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 12px;
  color: #94a3b8;
}

.toast-close {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  font-size: 16px;
  transition: color 0.2s;
}

.toast-close:hover {
  color: #f1f5f9;
}

.toast-out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(100px) scale(0.9);
  }
}

/* Pulse animation for success icon */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes successPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.toast-success .toast-icon {
  animation: successPulse 1.5s ease infinite;
}

/* ===== Quill Editor Dark Theme ===== */
.quill-editor-container {
  background: #1e293b;
  border-radius: 8px;
  border: 1px solid #334155;
  overflow: hidden;
}

.quill-editor-container .ql-toolbar {
  background: #0f172a;
  border: none;
  border-bottom: 1px solid #334155;
  padding: 8px 12px;
}

.quill-editor-container .ql-toolbar .ql-stroke {
  stroke: #94a3b8;
}

.quill-editor-container .ql-toolbar .ql-fill {
  fill: #94a3b8;
}

.quill-editor-container .ql-toolbar .ql-picker {
  color: #94a3b8;
}

.quill-editor-container .ql-toolbar .ql-picker-options {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 6px;
}

.quill-editor-container .ql-toolbar .ql-picker-item {
  color: #e2e8f0;
}

.quill-editor-container .ql-toolbar .ql-picker-item:hover {
  color: #3b82f6;
}

.quill-editor-container .ql-toolbar button:hover .ql-stroke,
.quill-editor-container .ql-toolbar button.ql-active .ql-stroke {
  stroke: #3b82f6;
}

.quill-editor-container .ql-toolbar button:hover .ql-fill,
.quill-editor-container .ql-toolbar button.ql-active .ql-fill {
  fill: #3b82f6;
}

.quill-editor-container .ql-toolbar .ql-picker-label:hover,
.quill-editor-container .ql-toolbar .ql-picker-label.ql-active {
  color: #3b82f6;
}

.quill-editor-container .ql-toolbar .ql-picker-label:hover .ql-stroke,
.quill-editor-container .ql-toolbar .ql-picker-label.ql-active .ql-stroke {
  stroke: #3b82f6;
}

.quill-editor-container .ql-container {
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
}

.quill-editor-container .ql-editor {
  background: #1e293b;
  color: #f1f5f9;
  min-height: 200px;
  padding: 16px;
}

.quill-editor-container .ql-editor.ql-blank::before {
  color: #64748b;
  font-style: normal;
}

.quill-editor-container .ql-editor h1,
.quill-editor-container .ql-editor h2,
.quill-editor-container .ql-editor h3 {
  color: #f1f5f9;
}

.quill-editor-container .ql-editor a {
  color: #3b82f6;
}

.quill-editor-container .ql-editor blockquote {
  border-left: 4px solid #3b82f6;
  padding-left: 16px;
  color: #94a3b8;
}

.quill-editor-container .ql-editor pre {
  background: #0f172a;
  border-radius: 6px;
  padding: 12px;
}

.quill-editor-container .ql-editor code {
  background: #0f172a;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Snow theme picker dropdown fix */
.ql-snow .ql-picker.ql-expanded .ql-picker-options {
  background: #1e293b;
}

.ql-snow .ql-tooltip {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f1f5f9;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.ql-snow .ql-tooltip input[type=text] {
  background: #0f172a;
  border: 1px solid #334155;
  color: #f1f5f9;
  border-radius: 4px;
}

.ql-snow .ql-tooltip a.ql-action::after,
.ql-snow .ql-tooltip a.ql-remove::before {
  color: #3b82f6;
}

/* Content display in forum */
.forum-content {
  line-height: 1.7;
}

.forum-content h1,
.forum-content h2,
.forum-content h3 {
  margin: 16px 0 8px 0;
  color: #f1f5f9;
}

.forum-content p {
  margin: 8px 0;
}

.forum-content ul,
.forum-content ol {
  padding-left: 24px;
  margin: 8px 0;
}

.forum-content blockquote {
  border-left: 4px solid #3b82f6;
  padding-left: 16px;
  margin: 12px 0;
  color: #94a3b8;
}

.forum-content pre {
  background: #0f172a;
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
}

.forum-content code {
  background: #0f172a;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

.forum-content a {
  color: #3b82f6;
}

.forum-content img {
  max-width: 100%;
  border-radius: 8px;
}

/* === USER CARD / PROFILE CARD === */
.user-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-radius: 12px;
  padding: 16px;
  min-width: 180px;
  border: 1px solid #334155;
  text-align: center;
}

.user-card-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

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

.user-card-status.offline {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.user-card-avatar {
  width: 90px;
  height: 90px;
  border-radius: 8px;
  object-fit: cover;
  margin: 0 auto 12px;
  display: block;
  border: 3px solid #334155;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
}

.user-card-avatar-placeholder {
  width: 90px;
  height: 90px;
  border-radius: 8px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  border: 3px solid #334155;
  background: linear-gradient(135deg, #1e293b, #334155);
  color: #64748b;
}

.user-card-username {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 6px;
}

.user-card-username.vip {
  color: #fbbf24;
}

.user-card-username.admin {
  color: #ef4444;
}

.user-card-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 6px;
}

.user-card-badge.admin {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
}

.user-card-badge.vip {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
}

.user-card-badge.member {
  background: rgba(148, 163, 184, 0.15);
  color: #f1f5f9;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.user-card-secondary {
  font-size: 9px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.user-card-separator {
  border-top: 1px solid #334155;
  margin: 12px 0;
}

.user-card-stats {
  font-size: 11px;
  color: #94a3b8;
  text-align: left;
}

.user-card-stats div {
  padding: 3px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-card-stats span.label {
  color: #64748b;
}

/* Help text para formulários */
.help-text {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
}

/* Avatar upload */
.avatar-upload-container {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.avatar-upload-container:hover .avatar-upload-overlay {
  opacity: 1;
}

.avatar-upload-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

/* Profile Page */
.profile-section {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid #334155;
  margin-bottom: 20px;
}

.profile-section h3 {
  font-size: 16px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-avatar-large {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  object-fit: cover;
  border: 4px solid #334155;
}

.profile-avatar-large-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  border: 4px solid #334155;
  background: linear-gradient(135deg, #1e293b, #334155);
  color: #64748b;
}
