/* Compatibility layer to map Angular attribute selectors to plain HTML in Laravel Blade */

/* Page background similar to legacy */
body {
  margin: 0;
  font-family: 'Roboto', sans-serif;
  background: linear-gradient(to bottom, rgba(50, 100, 160, 0.1), rgba(50, 100, 160, 0.1)), url("/assets/images/gunbg.png");
  background-repeat: repeat;
}

app-login {
  display: grid;
  grid-template-rows: auto 150px 100px 100px 200px auto;
  grid-template-columns: auto 500px auto;
  min-height: 100vh;
}

app-login .bg-footer {
  grid-row-start: 4;
  grid-row-end: -1;
  grid-column-start: 1;
  grid-column-end: -1;
  background: #24282e;
}

/* ===== Generic page grid (for panel pages) ===== */
#wrapper { padding: 30px; }
#page { box-shadow: 0 0 20px 3px rgba(0,0,0,0.5); }

/* Grid similar to legacy layout */
#page { display: grid; grid-template-columns: 230px auto; grid-template-rows: auto 1fr; min-height: calc(100vh - 30px); }
#page > main { display: block; grid-row-start: 2; grid-row-end: 3; grid-column: 2; background: #eee; padding-bottom: 10px; }

/* Header with server logo for panel pages */
#page > header { color: #fff; z-index: 5; background-color: #24282e; background-image: url('/assets/images/lsrplogo_big.png'); background-repeat: no-repeat; background-size: 70%; background-position: center; padding: 15px; height: 55px; grid-column: 1 / -1; }

/* ===== Left Panel (sidebar) mapping from legacy ===== */
#panel { background: #24282e; width: 230px; transition: all 0.3s; z-index: 3; grid-row: 2; grid-column: 1; overflow-y: auto; position: sticky; top: 0; height: 100vh; align-self: start; }
#panel * { white-space: nowrap; }

/* Sidebar user block */
#panel .user { width: 100%; padding: 10px; background: #24282e; position: relative; box-sizing: border-box; font-size: 1em; }
#panel .user .avatar { width: 45px; height: 45px; display: inline-block; }
#panel .user .avatar img { width: 100%; height: 100%; border-radius: 50px; }
#panel .user .description { display: inline-block; vertical-align: top; padding-left: 10px; color: white; line-height: 1; }
#panel .user .description .rank { color: rgba(255,255,255,0.75); display: block; line-height: 1; font-size: 1em; }
#panel .user .icons { color: rgba(255,255,255,0.75); display: inline; position: absolute; bottom: 10px; right: 10px; text-align: right; }
#panel .user .icons .icon { margin-left: 5px; cursor: pointer; }
#panel .user .icons .icon:hover { color: white; }

/* Sidebar categories and menu */
#panel > header { padding: 12px 15px; border-bottom: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; }
#panel > header h1 { font-size: 16px; color: #fff; margin: 0; font-weight: 600; }
#panel > header .panel-logo { max-width: 180px; width: 100%; height: auto; display: block; }

.category-wrapper { margin-top: 8px; }
#panel .category { background: #24282e; padding: 10px 15px; margin-top: 5px; cursor: default; user-select: none; }
#panel .category h2 { font-size: 1em; font-weight: bold; color: white; text-align: left; }

#panel ul.menu { padding: 0; margin: 0; }
#panel ul.menu li { color: rgba(255,255,255,0.9); padding: 8px 12px; margin-top: 0; cursor: pointer; font-size: 14px; list-style: none; outline: none; display: flex; align-items: center; }
#panel ul.menu li a { text-decoration: none; color: inherit; }
#panel ul.menu li i.fa, #panel ul.menu li svg { color: rgba(255,255,255,0.7); width: 18px; text-align: center; margin-right: 8px; }
#panel ul.menu li .link-label { margin-left: 4px; }
#panel ul.menu li:hover { color: #fff; background: rgba(255,255,255,0.05); }
#panel ul.menu li.selected { border-left: 3px solid #55a9fe; padding-left: 9px; color: white; background: rgba(255,255,255,0.05); }
#panel ul.menu li:last-child { margin-bottom: 20px !important; }

/* Compact (optional) */
#panel.compact { width: 50px; }
#panel.compact .category, #panel.compact .user .name, #panel.compact .user .description, #panel.compact .menu .link-label, #panel.compact .user .icons { display: none; }
#panel.compact .user .avatar { width: 50px; height: 50px; border-radius: 0; }
#panel.compact .menu li { font-size: 1.25em; }

/* ===== Topbar (from navbar.php app-topbar) ===== */
#topbar { grid-column: 2; grid-row: 1; background: #323439; color: #fff; position: relative; z-index: 4; }
#topbar .topbar-wrapper { display: grid; grid-template-columns: auto min-content; padding: 10px; align-items: center; }
#topbar .links { list-style: none; margin: 3px 0 0 0; padding: 0; }
#topbar .links li { display: inline-block; margin-right: 10px; }
#topbar .links li a { background: rgba(255,255,255,0.1); padding: 5px 10px; border-radius: 5px; color: rgba(255,255,255,0.5); text-decoration: none; }
#topbar .links li a:hover { background: rgba(255,255,255,0.2); color: rgba(255,255,255,0.8); }

#topbar .icons { display: flex; align-items: center; gap: 10px; font-weight: 500; }
#topbar .icons .user { display: flex; align-items: center; }
#topbar .icons .user .name { color: #fff; line-height: 1.2; margin-right: 10px; }
#topbar .icons .user .rank { color: #ddd; font-weight: 400; font-size: 12px; }

#topbar .icons .icon { margin-left: 10px; color: #eee; background: rgba(255,255,255,0.1); padding: 10px; border-radius: 50px; position: relative; cursor: pointer; }
#topbar .icons .icon:hover { background: rgba(255,255,255,0.2); }
#topbar .icons .notice { font-size: 0.9em; line-height: 1.5em; background: red; width: 18px; height: 18px; text-align: center; border-radius: 20px; position: absolute; right: 0; color: rgba(255,255,255,0.6); top: 0; }

/* Account dropdown panel */
#topbar .account-dropdown { position: absolute; right: 70px; top: 56px; background: #fff; color: #333; border-radius: 5px; box-shadow: 0 5px 10px 2px rgba(0,0,0,0.1); min-width: 280px; z-index: 5; }
#topbar .account-dropdown::after { content: ""; position: absolute; right: 10px; top: -10px; width: 20px; height: 20px; background: #fff; transform: rotate(45deg); border-radius: 3px; }
#topbar .account-dropdown .userinfo { padding: 15px; border-bottom: 1px solid #eee; }
#topbar .account-dropdown .userinfo .strongish { font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
#topbar .account-dropdown .menu a { color: #666; padding-left: 10px; }
#topbar .account-dropdown .menu a:hover { color: #000; }

/* Header with server logo */
app-login > header {
  background: url("/assets/images/lsrplogo_big.png") no-repeat center;
  background-position-y: 0;
  grid-column: 2/span 1;
  grid-row: 2/span 1;
}

/* Main container and card */
app-login > main {
  grid-row: 3/span 2;
  grid-column: 2/span 1;
  z-index: 1;
}

app-login > main a {
  color: #fff;
  text-decoration: none;
}

app-login > main a:hover { margin-top: -1px; }

/* Fieldset (login card) */
.fieldset {
  background: #34373d;
  color: #eee;
  box-shadow: 0px 0px 20px 3px rgba(5, 5, 0, 0.2);
  border-radius: 5px;
  width: 400px;
  height: 100%;
  margin: auto;
  display: grid;
  grid-template-columns: 36px auto; /* fixed icon column to match legacy */
  grid-auto-rows: max-content;
  padding: 20px;
}

.fieldset .label {
  background: #3264a0;
  color: #e5e5e5;
  grid-column-start: 1;
  display: block;
  width: 36px;
  height: 36px; /* 16 + 10 + 10 in legacy => 36px */
  line-height: 36px; /* center icon vertically */
  text-align: center; /* center icon horizontally */
  padding: 0; /* padding is accounted for via fixed size */
  border-radius: 5px 0 0 5px;
  font-size: 14px; /* closer to original FA icon size */
}

.fieldset input {
  margin-bottom: 20px;
  font-size: 15px;
  padding: 10px; /* match legacy: 16px height + 10px padding top/bottom = 36px total */
  background: #43474c;
  color: #eee;
  border: none;
  height: 16px; /* content height */
  border-radius: 0 5px 5px 0;
  box-sizing: content-box; /* keep total height = height + padding */
}

.fieldset input::placeholder { color: #ddd; }
.fieldset input:focus { outline: 0; }

/* Button */
app-login > main button,
.fieldset .fat {
  padding: 8px;
  border: 0;
  font-size: 14px;
  cursor: pointer;
  background: #3264a0;
  color: white;
  width: 100%;
  border-radius: 5px;
  height: 40px;
  margin-top: 15px;
}

/* Ensure the submit spans both columns and is visually centered within the card */
.fieldset .fat { grid-column: 1 / span 2; }

/* Footer under card */
app-login > main footer {
  text-align: center;
  margin-top: 10px;
  font-size: 14px;
}

/* Toast-like messages */
.message_pop_n li.info {
  background: #3264a0;
  color: rgba(255, 255, 255, 0.9);
  list-style: none;
  display: block;
  position: relative;
  min-width: 300px;
  margin: 10px auto;
  padding: 10px;
  box-sizing: border-box;
  border-radius: 5px;
  box-shadow: 2px 2px 12px 0 rgba(0, 0, 0, 0.3);
}

/* Top-right toast (for validation errors on auth pages) */
.toast-top-right{position:fixed;right:20px;top:20px;z-index:5000;display:grid;grid-auto-rows:min-content;gap:8px}
.toast{background:#e53935;color:#fff;border-radius:6px;box-shadow:0 8px 24px rgba(0,0,0,.18);padding:10px 12px;min-width:280px;max-width:420px;line-height:1.35}
.toast .title{font-weight:700;margin-bottom:4px}
.toast .meta{opacity:.9;font-size:12px}

/* Flex layout for richer toast content (icon + text + close) */
.toast.flex{
  /* Use grid to avoid rare vertical text issues with flex in some environments */
  display:grid;
  grid-template-columns: auto 1fr auto;
  align-items:flex-start;
  gap:10px;
  padding:12px;
}
.toast .icon{flex:0 0 auto;color:#ffcdd2;display:flex;align-items:center}
.toast .body{flex:1 1 auto;margin-top:1px}
.toast .body .title{color:#ffcdd2;font-size:14px;margin:0;font-weight:600}
.toast .body .desc{color:#ffeaea;margin-top:4px;font-size:13px}
.toast .close{flex:0 0 auto;color:#ffcdd2;background:transparent;border:0;cursor:pointer;border-radius:6px;padding:4px;line-height:0}
.toast .close:hover{filter:brightness(.9)}

.message_pop_n .icon { color: white; border-right: 1px solid rgba(255,255,255,0.3); padding-right: 10px; margin-right: 5px; }

/* ===== Panel: Characters (compat mapping) ===== */
app-character-list { display: block; }

.content-header { color: #fff; padding: 10px 20px; }
.content-header h3 { margin: 0; font-weight: 500; }

/* Grid container like legacy */
/* Constrain content width for clean layout */
app-character-list .content-header,
app-character-list .content {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  grid-auto-rows: min-content;
  grid-gap: 20px;
  padding: 20px;
  max-width: 100%; /* full-width container */
  margin: 0 auto;
}

/* Reduce bottom padding on content to avoid extra empty space */
app-character-list .content { padding-bottom: 10px; }

/* Visual header bar like legacy */
app-character-list .content-header { grid-template-columns: 1fr; background: #f5f5f5; color: #333; border-bottom: 1px solid #e0e0e0; border-top-left-radius: 3px; border-top-right-radius: 3px; }
app-character-list .content-header h3 { margin: 0; padding: 8px 0; font-weight: 500; font-size: 20px; }

/* Card sizing: 3 per row (24 / 8) */
.csquarterthird { grid-column: span 8; }

/* Character preview card */
.character_preview {
  background-color: #fff;
  background-repeat: no-repeat;
  /* Use legacy preview sizing/position */
  background-size: 75%;
  background-position: left -80px bottom -440px; /* stick the model to bottom-left like screenshot */
  min-height: 220px;
  cursor: pointer;
  line-height: normal;
  box-shadow: 2px 2px 8px 0px rgba(0, 0, 0, 0.15);
  padding: 15px;
  box-sizing: border-box;
  border-radius: 3px;
}

.character_preview .card-title { 
  display: flex; 
  align-items: flex-start; 
  justify-content: space-between;
}
.character_preview .card-title .title-stack {
  display: flex;
  flex-direction: column;
}
.character_preview .card-title .title-stack .name {
  font-weight: 600;
  color: #333;
}
.character_preview .card-title .title-stack .sub {
  font-size: 13px;
  color: #666;
}
.character_preview .card-title .cid {
  color: rgba(0,0,0,0.45);
  font-size: 13px;
}

/* bottom-right stacked stats */
.character_stats {
  position: absolute;
  right: 15px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  color: #333;
}
.character_stats .detail { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.character_stats .icon { color: #3264a0; } /* 蓝色图标 */
.character_stats .icon i { color: #3264a0; }
.character_preview .card-title .color-grey { color: rgba(0,0,0,0.5); }

.character_ic_info { float: right; padding-top: 10px; padding-right: 10px; line-height: normal; text-shadow: 0 0 9px #fff; min-width: 50%; }
.character_ic_info .key { display: inline-block; font-size: 12px; text-transform: uppercase; margin-right: 6px; color: rgba(0,0,0,0.6); }
.character_ic_info .value { display: inline-block; font-size: 14px; font-weight: bold; margin-right: 12px; }

@media only screen and (max-width: 1000px) {
  .csquarterthird { grid-column: span 12; }
}
@media only screen and (max-width: 600px) {
  .csquarterthird { grid-column: span 24; }
}

/* (removed sidebar layout overrides to avoid width/spacing changes) */

/* ===== Utilities & minor visual tweaks matching legacy ===== */
.fl-ri { float: right; }
.fl-le { float: left; }
.flexy { display: flex; align-items: center; }
.color-grey { color: rgba(0,0,0,0.5); }

/* Section helpers referenced in legacy */
.section-border-gradient { border: 1px solid rgba(0,0,0,0.1); border-radius: 5px; padding: 15px; background: linear-gradient(to bottom, #eee, #f5f5f5); }
.transparent { background: transparent !important; box-shadow: none !important; }

/* Content header links in panel */
.content-header a { color: #fff; text-decoration: none; }
.content-header a:hover { text-decoration: underline; }

/* ================= Mobile optimizations: Login page ================= */
@media (max-width: 600px) {
  app-login header { 
    display:flex; align-items:center; justify-content:center; 
    padding: 10px; 
    min-height: 160px;            /* 再加高，确保 Logo 不被覆盖 */
    position: relative; 
    z-index: 0;                   /* 让表单层级在 header 之上，防止背景压到表单 */
    background-position: center top; 
    background-repeat: no-repeat; 
    background-size: 70% auto;    /* 稍微再小一点 */
  }
  app-login header .login-logo { max-width: 70%; height: auto; display:block; }
  app-login main { padding: 10px; margin-top: 220px; position: relative; z-index: 1; }
  app-login .fieldset {
    width: 100%;
    max-width: 100%;
    padding: 12px;
    display: grid;
    grid-template-columns: 36px auto;
    grid-row-gap: 8px;
    box-sizing: border-box;
  }
  .fieldset .label { width: 36px; height: 44px; }
  .fieldset input {
    height: 44px;
    font-size: 16px; /* avoid iOS zoom */
    padding: 10px 12px;
    box-sizing: border-box;
  }
  .fieldset button.fat {
    height: 44px;
    font-size: 16px;
    grid-column: 1 / span 2;
    margin-top: 8px;
  }
  .message_pop_n { max-width: 100%; }
}

/* Desktop/login logo sizing (non-intrusive) */
app-login header .login-logo { max-width: 320px; width: 60%; height: auto; display:block; margin: 0 auto; }
