/* =========================================================
   VELAEA CENTER - LIGHT THEME POLISH / QA FIX
   Scope: Light mode only. Does not change dark theme.
   Purpose: improve contrast, readability, cards, tables,
   drawers, modals, sidebars, admin pages and compact pages.
   ========================================================= */

html[data-theme="light"],
html:not([data-theme]),
body.light-mode{
  color-scheme: light;
  --bg:#f4f7fb;
  --bg2:#eef3f8;
  --panel:#ffffff;
  --panel2:#f8fbff;
  --panel3:#f1f5fa;
  --text:#071a2f;
  --heading:#041529;
  --muted:#52657b;
  --muted2:#6f8194;
  --gold:#b98519;
  --gold2:#d8a642;
  --green:#0c8f4d;
  --red:#d13f43;
  --blue:#2c6fc8;
  --line:rgba(128,93,23,.22);
  --line2:rgba(7,26,47,.10);
  --input:#ffffff;
  --shadow:0 20px 56px rgba(7,26,47,.11);

  --vc-bg:#f4f7fb;
  --vc-bg-soft:#edf3f8;
  --vc-bg-gradient:linear-gradient(180deg,#f7faff 0%,#edf3f8 54%,#ffffff 100%);
  --vc-surface:#ffffff;
  --vc-surface-2:#f8fbff;
  --vc-card:#ffffff;
  --vc-card-2:#f6f9fd;
  --vc-text:#071a2f;
  --vc-heading:#041529;
  --vc-muted:#52657b;
  --vc-line:rgba(7,26,47,.11);
  --vc-line-gold:rgba(128,93,23,.22);
  --vc-gold:#b98519;
  --vc-gold-2:#d8a642;
  --vc-gold-soft:rgba(185,133,25,.12);
  --vc-green:#0c8f4d;
  --vc-red:#d13f43;
  --vc-blue:#2c6fc8;
  --vc-shadow:0 20px 56px rgba(7,26,47,.11);
  --vc-shadow-soft:0 10px 28px rgba(7,26,47,.08);
  --vc-input-bg:#ffffff;
  --vc-input-text:#071a2f;
  --vc-input-border:rgba(7,26,47,.16);
  --vc-sidebar-bg:linear-gradient(180deg,#ffffff,#f5f8fc 58%,#ffffff);
  --vc-topbar-bg:rgba(255,255,255,.88);

  --card-bg:#ffffff;
  --card-bg-2:#f8fbff;
  --text-strong:#041529;
}

html[data-theme="light"] body,
html:not([data-theme]) body,
body.light-mode{
  background:
    radial-gradient(circle at 82% -8%,rgba(216,166,66,.18),transparent 30%),
    linear-gradient(180deg,#f7faff 0%,#edf3f8 58%,#ffffff 100%) !important;
  color:var(--text)!important;
}

/* Core text contrast */
html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4,
html[data-theme="light"] h5,
html[data-theme="light"] h6,
html[data-theme="light"] .page-title,
html[data-theme="light"] .hero h1,
html[data-theme="light"] .hero-title,
html[data-theme="light"] .detail-title,
html[data-theme="light"] .card-title,
html[data-theme="light"] .panel h2,
html[data-theme="light"] .panel h3,
html[data-theme="light"] .welcome h1,
html[data-theme="light"] .welcome h2,
html[data-theme="light"] .section-title,
html[data-theme="light"] .forum-title,
html[data-theme="light"] .topic-title,
html[data-theme="light"] .page-title,
html[data-theme="light"] .brand-title{
  color:var(--heading)!important;
  text-shadow:none!important;
}

html[data-theme="light"] body,
html[data-theme="light"] p,
html[data-theme="light"] li,
html[data-theme="light"] td,
html[data-theme="light"] label,
html[data-theme="light"] .text,
html[data-theme="light"] .value,
html[data-theme="light"] .info-list strong,
html[data-theme="light"] .metric strong,
html[data-theme="light"] .stat-card strong,
html[data-theme="light"] .card strong,
html[data-theme="light"] .panel strong,
html[data-theme="light"] .user strong,
html[data-theme="light"] .account-top-user strong{
  color:var(--text)!important;
}

html[data-theme="light"] .muted,
html[data-theme="light"] small,
html[data-theme="light"] .help-text,
html[data-theme="light"] .sub,
html[data-theme="light"] .subtitle,
html[data-theme="light"] .hero p,
html[data-theme="light"] .hero-lead,
html[data-theme="light"] .card-meta,
html[data-theme="light"] .detail-sub,
html[data-theme="light"] .metric small,
html[data-theme="light"] .stat-card span,
html[data-theme="light"] .info-list span,
html[data-theme="light"] .table-sub,
html[data-theme="light"] .chart-caption,
html[data-theme="light"] .nav-title,
html[data-theme="light"] .lang-note,
html[data-theme="light"] .lang-kicker{
  color:var(--muted)!important;
}

html[data-theme="light"] .gold,
html[data-theme="light"] .eyebrow,
html[data-theme="light"] .panel-link,
html[data-theme="light"] .highlight,
html[data-theme="light"] .nav a.active,
html[data-theme="light"] .community-menu a.active,
html[data-theme="light"] .public-menu a.active{
  color:var(--gold)!important;
}

/* Layout surfaces */
html[data-theme="light"] .app,
html[data-theme="light"] .main,
html[data-theme="light"] .content,
html[data-theme="light"] main,
html[data-theme="light"] .community-main,
html[data-theme="light"] .lab-main,
html[data-theme="light"] .public-main{
  color:var(--text)!important;
}

html[data-theme="light"] .sidebar,
html[data-theme="light"] .dashboard-sidebar,
html[data-theme="light"] .admin-sidebar{
  background:var(--vc-sidebar-bg)!important;
  border-right-color:var(--line)!important;
  box-shadow:10px 0 34px rgba(7,26,47,.055)!important;
}

html[data-theme="light"] .topbar,
html[data-theme="light"] .community-header,
html[data-theme="light"] .lab-header,
html[data-theme="light"] .public-header,
html[data-theme="light"] .bt-header,
html[data-theme="light"] .admin-topbar{
  background:rgba(255,255,255,.90)!important;
  border-bottom-color:var(--line)!important;
  box-shadow:0 12px 34px rgba(7,26,47,.07)!important;
  backdrop-filter:blur(18px)!important;
}

html[data-theme="light"] .hero,
html[data-theme="light"] .welcome,
html[data-theme="light"] .panel,
html[data-theme="light"] .card,
html[data-theme="light"] .auth-card,
html[data-theme="light"] .metric,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .showcase-card,
html[data-theme="light"] .showcase-panel,
html[data-theme="light"] .forum-card,
html[data-theme="light"] .forum-category-card,
html[data-theme="light"] .topic-card,
html[data-theme="light"] .ea-card,
html[data-theme="light"] .project-card,
html[data-theme="light"] .portfolio-card,
html[data-theme="light"] .portfolio-full-card,
html[data-theme="light"] .detail-card,
html[data-theme="light"] .loading-card,
html[data-theme="light"] .checkout-card,
html[data-theme="light"] .license-card,
html[data-theme="light"] .notification-card,
html[data-theme="light"] .support-card,
html[data-theme="light"] .share-box,
html[data-theme="light"] .score-box,
html[data-theme="light"] .info-panel,
html[data-theme="light"] .trade-panel,
html[data-theme="light"] .big-chart,
html[data-theme="light"] .side-chart,
html[data-theme="light"] .chart-shell,
html[data-theme="light"] .bt-hero-card,
html[data-theme="light"] .bt-card,
html[data-theme="light"] .bt-panel,
html[data-theme="light"] .bt-chart,
html[data-theme="light"] .bt-metric,
html[data-theme="light"] .lab-card,
html[data-theme="light"] .lab-panel,
html[data-theme="light"] .request-card,
html[data-theme="light"] .slot-card,
html[data-theme="light"] .queue-card,
html[data-theme="light"] .account-status-card,
html[data-theme="light"] .account-mini-card,
html[data-theme="light"] .mt5-account-card,
html[data-theme="light"] .mt5-number-card,
html[data-theme="light"] .mt5-analytics-card,
html[data-theme="light"] .mt5-chart-box,
html[data-theme="light"] .dashboard-backtest-card,
html[data-theme="light"] .dashboard-backtest-info-card,
html[data-theme="light"] .modal,
html[data-theme="light"] .modal-card,
html[data-theme="light"] .drawer,
html[data-theme="light"] .detail-drawer,
html[data-theme="light"] .lang-panel,
html[data-theme="light"] details{
  background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(248,251,255,.94))!important;
  color:var(--text)!important;
  border-color:var(--line)!important;
  box-shadow:var(--shadow)!important;
}

html[data-theme="light"] .hero::before,
html[data-theme="light"] .welcome::before,
html[data-theme="light"] .panel::before,
html[data-theme="light"] .card::before,
html[data-theme="light"] .showcase-card::before,
html[data-theme="light"] .showcase-panel::before,
html[data-theme="light"] .detail-drawer::before{
  opacity:.45!important;
}

/* Navigation */
html[data-theme="light"] .nav a,
html[data-theme="light"] .top-nav a,
html[data-theme="light"] .community-menu a,
html[data-theme="light"] .lab-menu a,
html[data-theme="light"] .public-menu a,
html[data-theme="light"] .bt-menu a{
  color:#31465c!important;
  border-color:transparent!important;
}

html[data-theme="light"] .nav a:hover,
html[data-theme="light"] .nav a.active,
html[data-theme="light"] .top-nav a:hover,
html[data-theme="light"] .top-nav a.active,
html[data-theme="light"] .community-menu a:hover,
html[data-theme="light"] .community-menu a.active,
html[data-theme="light"] .lab-menu a:hover,
html[data-theme="light"] .lab-menu a.active,
html[data-theme="light"] .public-menu a:hover,
html[data-theme="light"] .public-menu a.active,
html[data-theme="light"] .bt-menu a:hover,
html[data-theme="light"] .bt-menu a.active{
  background:linear-gradient(90deg,rgba(185,133,25,.14),rgba(185,133,25,.045))!important;
  color:#7a540e!important;
  border-color:rgba(185,133,25,.22)!important;
}

html[data-theme="light"] .brand,
html[data-theme="light"] .panel-head,
html[data-theme="light"] .card-head,
html[data-theme="light"] .modal-head,
html[data-theme="light"] .drawer-head,
html[data-theme="light"] .bt-section-head{
  border-color:var(--line2)!important;
}

/* Buttons / controls */
html[data-theme="light"] .btn,
html[data-theme="light"] .btn-ghost,
html[data-theme="light"] .btn-outline,
html[data-theme="light"] .btn-secondary,
html[data-theme="light"] .icon-btn,
html[data-theme="light"] .menu-btn,
html[data-theme="light"] .theme-toggle,
html[data-theme="light"] .community-theme-toggle,
html[data-theme="light"] .public-theme-toggle,
html[data-theme="light"] .bt-theme-toggle,
html[data-theme="light"] .lang-trigger,
html[data-theme="light"] .filter-chip,
html[data-theme="light"] .category-chip,
html[data-theme="light"] .tab-btn,
html[data-theme="light"] .detail-tab,
html[data-theme="light"] .pagination-btn,
html[data-theme="light"] .mt5-history-page-btn,
html[data-theme="light"] .forum-scroll-btn{
  background:#ffffff!important;
  color:var(--text)!important;
  border-color:var(--line)!important;
  box-shadow:0 8px 22px rgba(7,26,47,.06)!important;
}

html[data-theme="light"] .btn:hover,
html[data-theme="light"] .btn-ghost:hover,
html[data-theme="light"] .btn-outline:hover,
html[data-theme="light"] .icon-btn:hover,
html[data-theme="light"] .filter-chip:hover,
html[data-theme="light"] .filter-chip.active,
html[data-theme="light"] .category-chip:hover,
html[data-theme="light"] .category-chip.active,
html[data-theme="light"] .tab-btn.active,
html[data-theme="light"] .detail-tab.active,
html[data-theme="light"] .pagination-btn.active,
html[data-theme="light"] .mt5-history-page-btn.active{
  background:linear-gradient(135deg,#fff8e8,#ffffff)!important;
  color:#7a540e!important;
  border-color:rgba(185,133,25,.35)!important;
}

html[data-theme="light"] .btn-gold,
html[data-theme="light"] .theme-gold-btn,
html[data-theme="light"] .auth-action-btn[data-auth-state="logged-in"]{
  background:linear-gradient(135deg,#ffe0a0,#c8952e)!important;
  color:#1d1205!important;
  border-color:transparent!important;
  text-shadow:none!important;
}

html[data-theme="light"] .btn-red,
html[data-theme="light"] .danger,
html[data-theme="light"] .logout,
html[data-theme="light"] .nav-logout,
html[data-theme="light"] .auth-action-btn[data-auth-state="guest"],
html[data-theme="light"] .auth-action-btn[data-auth-state="error"]{
  background:#fff6f6!important;
  color:#b1282c!important;
  border-color:rgba(209,63,67,.25)!important;
}

/* Forms */
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea,
html[data-theme="light"] .search-box,
html[data-theme="light"] .search-box input,
html[data-theme="light"] .select-wrap,
html[data-theme="light"] .select-wrap select,
html[data-theme="light"] .input,
html[data-theme="light"] .form-control{
  background:#ffffff!important;
  color:var(--text)!important;
  border-color:rgba(7,26,47,.16)!important;
  box-shadow:none!important;
}

html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder,
html[data-theme="light"] .search-box input::placeholder{
  color:#8a9aab!important;
  opacity:1!important;
}

html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus{
  border-color:rgba(185,133,25,.55)!important;
  box-shadow:0 0 0 4px rgba(185,133,25,.10)!important;
}

/* Tables */
html[data-theme="light"] .table-wrap,
html[data-theme="light"] .mt5-table-wrap,
html[data-theme="light"] .trade-table-wrap,
html[data-theme="light"] .bt-table-wrap{
  background:#ffffff!important;
  border-color:var(--line2)!important;
}

html[data-theme="light"] table,
html[data-theme="light"] .trade-mini-table,
html[data-theme="light"] .mt5-table{
  color:var(--text)!important;
}

html[data-theme="light"] th,
html[data-theme="light"] .trade-mini-table th,
html[data-theme="light"] .mt5-table th{
  color:#52657b!important;
  background:#f1f5fa!important;
  border-bottom-color:rgba(7,26,47,.10)!important;
}

html[data-theme="light"] td,
html[data-theme="light"] .trade-mini-table td,
html[data-theme="light"] .mt5-table td{
  color:#10243a!important;
  border-bottom-color:rgba(7,26,47,.085)!important;
}

html[data-theme="light"] tr:hover td,
html[data-theme="light"] .trade-mini-table tr:hover td,
html[data-theme="light"] .mt5-table tr:hover td{
  background:#f8fbff!important;
}

/* Badges and status */
html[data-theme="light"] .badge,
html[data-theme="light"] .type-badge,
html[data-theme="light"] .micro-badge,
html[data-theme="light"] .status-badge,
html[data-theme="light"] .pill,
html[data-theme="light"] .chip,
html[data-theme="light"] .bt-badge,
html[data-theme="light"] .ealab-status-pill,
html[data-theme="light"] .mt5-live-badge,
html[data-theme="light"] .mt5-visibility-pill,
html[data-theme="light"] .allocation-mini{
  background:#fff7e6!important;
  color:#7a540e!important;
  border-color:rgba(185,133,25,.28)!important;
  text-shadow:none!important;
}

html[data-theme="light"] .badge-success,
html[data-theme="light"] .status-badge.online,
html[data-theme="light"] .verified,
html[data-theme="light"] .online{
  background:#ecfff3!important;
  color:#0c7d43!important;
  border-color:rgba(12,143,77,.24)!important;
}

html[data-theme="light"] .status-badge.offline,
html[data-theme="light"] .locked,
html[data-theme="light"] .offline{
  background:#f3f6fa!important;
  color:#52657b!important;
  border-color:rgba(7,26,47,.12)!important;
}

html[data-theme="light"] .positive,
html[data-theme="light"] .up,
html[data-theme="light"] .profit-positive{
  color:var(--green)!important;
}
html[data-theme="light"] .negative,
html[data-theme="light"] .down,
html[data-theme="light"] .profit-negative{
  color:var(--red)!important;
}

/* Charts / SVG readability */
html[data-theme="light"] .mt5-chart-empty,
html[data-theme="light"] .empty-state,
html[data-theme="light"] .loading-state,
html[data-theme="light"] .chart-empty{
  background:#f8fbff!important;
  color:var(--muted)!important;
  border-color:rgba(185,133,25,.24)!important;
}

html[data-theme="light"] svg text,
html[data-theme="light"] .chart-label,
html[data-theme="light"] .axis-label{
  fill:#52657b!important;
  color:#52657b!important;
}

html[data-theme="light"] svg .grid line,
html[data-theme="light"] .grid-line{
  stroke:rgba(7,26,47,.10)!important;
}

html[data-theme="light"] .spark-line,
html[data-theme="light"] .balance-line,
html[data-theme="light"] .equity-line{
  filter:drop-shadow(0 4px 8px rgba(185,133,25,.18))!important;
}

/* Language, dropdown, modal, drawer */
html[data-theme="light"] .lang-backdrop:not([hidden]),
html[data-theme="light"] .detail-backdrop:not([hidden]),
html[data-theme="light"] .modal-backdrop:not([hidden]),
html[data-theme="light"] .backdrop:not([hidden]){
  background:rgba(7,26,47,.24)!important;
  backdrop-filter:blur(7px)!important;
}

html[data-theme="light"] .lang-grid button,
html[data-theme="light"] .dropdown-menu,
html[data-theme="light"] .public-lang-menu,
html[data-theme="light"] .community-language-switcher .lang-panel,
html[data-theme="light"] .lab-language-switcher .lang-panel{
  background:#ffffff!important;
  color:var(--text)!important;
  border-color:var(--line2)!important;
}

html[data-theme="light"] .lang-grid button:hover,
html[data-theme="light"] .lang-grid button.active,
html[data-theme="light"] .dropdown-menu a:hover,
html[data-theme="light"] .public-lang-menu button:hover,
html[data-theme="light"] .public-lang-menu button.active{
  background:#fff7e6!important;
  color:#7a540e!important;
}

html[data-theme="light"] .detail-close,
html[data-theme="light"] .modal-close,
html[data-theme="light"] .lang-close{
  background:#ffffff!important;
  color:#31465c!important;
  border-color:var(--line)!important;
}

/* Community forum horizontal filters */
html[data-theme="light"] .forum-tabs-wrap,
html[data-theme="light"] .forum-category-strip,
html[data-theme="light"] .showcase-filter-row{
  background:rgba(255,255,255,.62)!important;
  border-color:rgba(7,26,47,.08)!important;
}

/* Admin and compact pages */
html[data-theme="light"] .content,
html[data-theme="light"] .page,
html[data-theme="light"] .panel-pad,
html[data-theme="light"] .toolbar{
  color:var(--text)!important;
}

html[data-theme="light"] .bubble,
html[data-theme="light"] .message,
html[data-theme="light"] .chat-item{
  background:#ffffff!important;
  color:var(--text)!important;
  border-color:var(--line2)!important;
}

html[data-theme="light"] .bubble.admin,
html[data-theme="light"] .message.admin{
  background:#fff8e8!important;
  border-color:rgba(185,133,25,.25)!important;
}

/* Scrollbars only in light mode */
html[data-theme="light"]{
  scrollbar-color:rgba(185,133,25,.55) #edf3f8!important;
}
html[data-theme="light"] ::-webkit-scrollbar-track{background:#edf3f8!important;}
html[data-theme="light"] ::-webkit-scrollbar-thumb{border-color:#edf3f8!important;}

/* Prevent unreadable inverse text caused by old inline dark rules */
html[data-theme="light"] [style*="color:#fff"],
html[data-theme="light"] [style*="color: #fff"],
html[data-theme="light"] [style*="color:#ffffff"],
html[data-theme="light"] [style*="color: #ffffff"]{
  color:var(--text)!important;
}

/* Preserve white text on gold / danger buttons */
html[data-theme="light"] .btn-gold,
html[data-theme="light"] .btn-gold *,
html[data-theme="light"] .theme-gold-btn,
html[data-theme="light"] .theme-gold-btn *{
  color:#1d1205!important;
}

/* Mobile readability */
@media(max-width:760px){
  html[data-theme="light"] .sidebar.open,
  html[data-theme="light"] .public-menu.open,
  html[data-theme="light"] .community-menu.open,
  html[data-theme="light"] .lab-menu.open{
    background:#ffffff!important;
    color:var(--text)!important;
    border-color:var(--line)!important;
    box-shadow:0 20px 56px rgba(7,26,47,.14)!important;
  }
  html[data-theme="light"] .detail-drawer,
  html[data-theme="light"] .modal-card,
  html[data-theme="light"] .lang-panel{
    background:#ffffff!important;
  }
}
