/* LilyJoTracker v0.2.7n37 — Maritime Theme Foundation
   Scope: Tracker UI only. Public site is intentionally untouched.
*/

:root{
  --lj-theme-radius-sm:10px;
  --lj-theme-radius-md:14px;
  --lj-theme-radius-lg:18px;
  --lj-theme-shadow-soft:0 8px 24px rgba(8,49,72,.07);
  --lj-theme-shadow-card:0 10px 28px rgba(7,48,72,.08);
}

/* Maritime palette. All future Tracker component cleanup can consume these tokens. */
html[data-tracker-theme="maritime"]{
  --lj-bg:#dcecf2;
  --lj-bg-deep:#cfe4eb;
  --lj-surface:#f2f8fa;
  --lj-surface-2:#e7f2f6;
  --lj-surface-3:#dcecf2;
  --lj-border:#b8d3de;
  --lj-border-strong:#92b8c8;
  --lj-navy:#073b5a;
  --lj-navy-2:#0b5374;
  --lj-ocean:#0b789f;
  --lj-ocean-2:#1290aa;
  --lj-teal:#168e9f;
  --lj-text:#102b39;
  --lj-muted:#607987;
  --lj-muted-2:#78909b;
  --lj-success:#15975f;
  --lj-warning:#d99a23;
  --lj-danger:#d95b62;
  --lj-focus:rgba(11,120,159,.25);
}

/* Tracker-only application shell. */
html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active{
  background:
    radial-gradient(circle at 80% 8%, rgba(255,255,255,.70), transparent 30%),
    linear-gradient(145deg,var(--lj-bg-deep),var(--lj-bg) 46%,#e7f3f6);
  color:var(--lj-text);
}

/* Main tracker surfaces. Selectors are deliberately broad enough for old/new modules,
   but only while Tracker mode is active. */
html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active #app{
  background:transparent;
  color:var(--lj-text);
}

html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active
:is(.main,.app-main,.main-content,#main,#content-wrap,.workspace,.screen){
  background:transparent;
  color:var(--lj-text);
}

html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active #screen-header{
  background:rgba(244,249,251,.94);
  border-bottom:1px solid var(--lj-border);
  box-shadow:0 3px 14px rgba(7,55,80,.045);
}

html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active #screen-header .header-icon{
  background:linear-gradient(145deg,#e4f1f6,#d5e9f0);
  color:var(--lj-ocean);
  border:1px solid rgba(11,120,159,.08);
}

html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active #screen-header h1,
html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active .card-title,
html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active h1,
html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active h2,
html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active h3{
  color:var(--lj-text);
}

html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active
:is(.module-note,.header-copy p,.subtitle,.muted,.small,.field label){
  color:var(--lj-muted);
}

/* Primary building blocks. */
html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active
:is(.card,.metric,.panel,.section-card,.stat-card,.summary-card){
  background:rgba(244,249,251,.94);
  border-color:var(--lj-border);
  box-shadow:var(--lj-theme-shadow-card);
}

html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active .metric{
  background:linear-gradient(145deg,rgba(243,249,251,.98),rgba(229,241,246,.96));
}

html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active
:is(.badge,.pill,.chip,.tag){
  border-color:rgba(11,120,159,.16);
}

/* Tables: light nautical striping, without altering map/canvas layers. */
html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active table{
  color:var(--lj-text);
}

html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active table thead,
html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active table th{
  background:#dcecf2;
  color:#5e7784;
  border-color:var(--lj-border);
}

html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active table td{
  border-color:#d6e6ec;
}

html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active table tbody tr:nth-child(even){
  background:rgba(224,239,244,.48);
}

html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active table tbody tr:nth-child(odd){
  background:rgba(248,251,252,.72);
}

/* Form controls and buttons. */
html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active #app
:is(input:not([type="checkbox"]):not([type="radio"]),select,textarea,.input){
  background:#f8fbfc;
  color:var(--lj-text);
  border-color:var(--lj-border-strong);
}

html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active #app
:is(input:not([type="checkbox"]):not([type="radio"]),select,textarea,.input):focus{
  border-color:var(--lj-ocean);
  box-shadow:0 0 0 3px var(--lj-focus);
  outline:none;
}

html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active .btn{
  background:#eef6f8;
  color:var(--lj-text);
  border-color:var(--lj-border-strong);
}

html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active .btn:hover{
  background:#e2f0f4;
}

html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active .btn.primary{
  background:linear-gradient(145deg,var(--lj-ocean),#08698f);
  color:#fff;
  border-color:#08698f;
  box-shadow:0 7px 18px rgba(8,105,143,.18);
}

/* Sidebar: preserve its established identity, but bring it into one navy/ocean palette. */
html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active
:is(#sidebar,.sidebar,.app-sidebar){
  background:linear-gradient(180deg,var(--lj-navy) 0%,#08678a 56%,var(--lj-teal) 100%);
  color:#fff;
}

html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active
:is(#sidebar,.sidebar,.app-sidebar) :is(.nav-label,.group-label){
  color:rgba(225,243,249,.70);
}

html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active
:is(#sidebar,.sidebar,.app-sidebar) :is([data-nav],.nav-button,.group-button,.subnav-button){
  color:rgba(244,251,253,.92);
}

html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active
:is(#sidebar,.sidebar,.app-sidebar) :is([data-nav].active,.nav-button.active,.group-button.active,.subnav-button.active){
  background:rgba(255,255,255,.18);
  color:#fff;
  box-shadow:inset 3px 0 0 rgba(157,224,245,.90);
}

html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active
:is(#sidebar-status,#sidebar-ship,.sidebar-status,.sidebar-card){
  background:rgba(225,246,250,.16);
  border-color:rgba(216,243,249,.20);
  color:#f3fbfd;
}

/* Status bar and separators. */
html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active #statusbar{
  background:linear-gradient(90deg,#075070,#0b6684);
  color:#eefbff;
  border-color:rgba(255,255,255,.12);
}

/* Keep maps, chart canvases and image content visually untouched. */
html[data-tracker-theme="maritime"] body.lilyjo-tracker-theme-active
:is(.leaflet-container,canvas,img,svg){
  filter:none;
}

/* Theme chooser injected into Settings. */
#lilyjo-tracker-theme-n37{
  margin-top:16px;
}
#lilyjo-tracker-theme-n37 .lj-theme-options{
  display:grid;
  grid-template-columns:repeat(2,minmax(220px,1fr));
  gap:12px;
  margin-top:14px;
}
#lilyjo-tracker-theme-n37 .lj-theme-option{
  appearance:none;
  width:100%;
  text-align:left;
  border:1px solid var(--lj-border,#c9d9df);
  border-radius:14px;
  background:#fff;
  padding:14px;
  cursor:pointer;
  transition:.16s ease;
  color:inherit;
}
#lilyjo-tracker-theme-n37 .lj-theme-option:hover{
  transform:translateY(-1px);
  box-shadow:0 7px 18px rgba(8,62,88,.08);
}
#lilyjo-tracker-theme-n37 .lj-theme-option.active{
  border-color:var(--lj-ocean,#0b789f);
  box-shadow:0 0 0 3px rgba(11,120,159,.13);
}
#lilyjo-tracker-theme-n37 .lj-theme-preview{
  display:grid;
  grid-template-columns:36% 1fr;
  height:58px;
  border-radius:10px;
  overflow:hidden;
  margin-bottom:10px;
  border:1px solid rgba(20,76,98,.12);
}
#lilyjo-tracker-theme-n37 .lj-theme-preview > i{
  display:block;
}
#lilyjo-tracker-theme-n37 .lj-theme-preview > span{
  display:grid;
  grid-template-rows:1fr 1fr;
}
#lilyjo-tracker-theme-n37 .lj-theme-preview span i{
  display:block;
}
#lilyjo-tracker-theme-n37 .preview-maritime > i{background:#074866}
#lilyjo-tracker-theme-n37 .preview-maritime span i:first-child{background:#dcecf2}
#lilyjo-tracker-theme-n37 .preview-maritime span i:last-child{background:#f2f8fa}
#lilyjo-tracker-theme-n37 .preview-classic > i{background:#08738f}
#lilyjo-tracker-theme-n37 .preview-classic span i:first-child{background:#dff5f6}
#lilyjo-tracker-theme-n37 .preview-classic span i:last-child{background:#fff}
#lilyjo-tracker-theme-n37 .lj-theme-option strong{
  display:block;
  font-size:15px;
  margin-bottom:3px;
}
#lilyjo-tracker-theme-n37 .lj-theme-option small{
  display:block;
  color:var(--lj-muted,#667c87);
  line-height:1.35;
}
#lilyjo-tracker-theme-n37 .lj-theme-current{
  margin-top:12px;
  font-size:13px;
  color:var(--lj-muted,#667c87);
}

@media(max-width:760px){
  #lilyjo-tracker-theme-n37 .lj-theme-options{grid-template-columns:1fr}
}
