/* =========================================
   L-Training Theme (Stable Layout)
   ========================================= */

/* --- Global Colors & Base --- */
:root {
  --primary:#1e3a8a;
  --primary-2:#1e40af;
  --ink:#0f172a;
  --muted:#64748b;
  --line:#e2e8f0;
  --bg:#f8f9fa;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  font-family:'Sarabun','Segoe UI',Tahoma,Geneva,Verdana,sans-serif;
  line-height:1.7; color:#2c3e50; background:var(--bg);
}
a{text-decoration:none}

/* --- Navbar --- */
.navbar{
  position:sticky; top:0; z-index:1000;
  background:#fff; border-bottom:1px solid #e9ecef;
  box-shadow:0 2px 10px rgba(0,0,0,.05)
}
.navbar-inner{
  max-width:1200px; margin:0 auto; padding:.8rem 2rem;
  display:flex; align-items:center; justify-content:space-between
}
.brand{font-size:1.75rem; font-weight:700; color:var(--primary)}
.nav-actions{display:flex; align-items:center; gap:.5rem; flex-wrap:wrap}

/* --- Buttons --- */
.btn{
  display:inline-block; padding:.5rem 1rem; font-size:.9rem;
  border-radius:8px; border:1px solid transparent;
  transition:.15s all; font-weight:500
}
.btn-outline-primary{border-color:var(--primary); color:var(--primary); background:transparent}
.btn-outline-primary:hover{background:var(--primary); color:#fff}
.btn-primary{background:var(--primary); border-color:var(--primary); color:#fff}
.btn-primary:hover{background:var(--primary-2)}
.btn-outline-secondary{border-color:#cbd5e1; color:#334155; background:transparent}
.btn-outline-secondary:hover{background:#f1f5f9}
.btn-outline-danger{border-color:#dc2626; color:#dc2626; background:transparent}
.btn-outline-danger:hover{background:#fee2e2}
.btn-warning{background:#facc15; color:var(--primary); border:1px solid #facc15}

/* --- Footer --- */
footer{background:var(--primary); color:#fff; margin-top:3rem}
.footer-inner{max-width:1200px; margin:0 auto; padding:2.2rem 2rem}
.footer-grid{display:grid; grid-template-columns:2fr 1fr 1fr 1fr; gap:2rem}
.footer-title{font-size:1.2rem; font-weight:700; margin-bottom:1rem}
.footer-link{color:#cbd5e1; font-size:.95rem}
.footer-link:hover{color:#fff}
.footer-bottom{margin-top:1.2rem; padding-top:1rem; border-top:1px solid rgba(255,255,255,.15); text-align:center; color:#cbd5e1; font-size:.92rem}

/* --- Login/Register --- */
.page-min{min-height:calc(100vh - 56px - 52px)}
.auth-wrap{display:flex; align-items:center; justify-content:center; padding:2rem}
.card-auth{background:#fff; border:1px solid var(--line); border-radius:12px; box-shadow:0 4px 20px rgba(0,0,0,.06)}
.card-body-auth{padding:2rem 2.2rem}
.title-auth{font-size:1.7rem; font-weight:700; color:var(--primary); text-align:center; margin-bottom:1.2rem}
.form-label{font-weight:600; color:#334155; margin-bottom:.25rem; font-size:.95rem}
.form-control{width:100%; padding:.6rem .8rem; border:1px solid #cbd5e1; border-radius:8px; font-size:.95rem; transition:all .15s}
.form-control:focus{outline:none; border-color:var(--primary); box-shadow:0 0 0 2px rgba(30,58,138,.2)}
.btn-full{width:100%; padding:.75rem; border-radius:8px; font-weight:600}
.link{display:block; text-align:center; margin-top:.75rem; color:var(--primary); font-weight:500}
.link:hover{text-decoration:underline}

/* --- Index Page (เดิม) --- */
.container{max-width:1200px; margin:0 auto; padding:0 2rem}
.section{padding:3rem 0}
.title{font-size:2.2rem; font-weight:700; color:var(--primary); text-align:center; margin-bottom:2rem; position:relative}
.title:after{content:''; width:64px; height:3px; border-radius:2px; background:var(--primary); position:absolute; left:50%; transform:translateX(-50%); bottom:-12px}

.grid{display:grid; grid-template-columns:repeat(3,1fr); gap:1.2rem; margin-top:2rem}
.card{background:#fff; border:1px solid var(--line); border-radius:12px; overflow:hidden; box-shadow:0 3px 12px rgba(0,0,0,.06); transition:transform .15s, box-shadow .15s}
.card:hover{transform:translateY(-4px); box-shadow:0 8px 22px rgba(0,0,0,.1)}
.card-cover{height:120px; display:flex; align-items:center; justify-content:center; background:#f1f5f9; color:var(--primary); font-size:2rem; border-bottom:1px solid var(--line)}
.card-body{padding:1.2rem}
.card-title{font-weight:700; color:var(--primary); font-size:1.05rem; margin-bottom:.4rem; line-height:1.35}
.card-desc{color:#64748b; font-size:.92rem; line-height:1.55; margin-bottom:.8rem; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden}
.meta{display:flex; gap:.5rem; flex-wrap:wrap; margin-bottom:.9rem}
.chip{font-size:.78rem; padding:.25rem .6rem; border:1px solid #cbd5e1; border-radius:999px; background:#f8fafc; color:#0f172a}
.cta{display:inline-block; background:var(--primary); color:#fff; padding:.6rem 1.1rem; border-radius:8px; font-weight:600}
.cta:hover{background:var(--primary-2)}
/* ==== Minimal modal styles (เมื่อไม่ใช้ bootstrap.css) ==== */
.modal{position:fixed; inset:0; display:none; background:rgba(15,23,42,.45); z-index:1050;}
.modal.show{display:block;}
.modal-dialog{max-width:720px; margin:3.5rem auto; padding:0 1rem;}
.modal-dialog.modal-lg{max-width:900px;}
.modal-dialog.modal-sm{max-width:420px;}
.modal-content{background:#fff; border-radius:12px; box-shadow:0 20px 40px rgba(2,6,23,.25); overflow:hidden;}
.modal-header,.modal-footer{padding:.9rem 1rem; border-bottom:1px solid #e5e7eb; display:flex; align-items:center; gap:.5rem;}
.modal-header{justify-content:space-between;}
.modal-footer{border-top:1px solid #e5e7eb; border-bottom:none; justify-content:flex-end;}
.modal-body{padding:1rem; max-height:70vh; overflow:auto;}
.btn-close{appearance:none; border:0; background:transparent; width:32px; height:32px; border-radius:8px; position:relative;}
.btn-close::before,.btn-close::after{content:""; position:absolute; top:50%; left:50%; width:16px; height:2px; background:#475569; transform-origin:center;}
.btn-close::before{transform:translate(-50%,-50%) rotate(45deg);}
.btn-close::after{transform:translate(-50%,-50%) rotate(-45deg);}


/* --- Responsive --- */
@media (max-width:1024px){ .grid{grid-template-columns:repeat(2,1fr)} }
@media (max-width:768px){
  .navbar-inner{padding:.8rem 1rem}
  .container{padding:0 1rem}
  .grid{grid-template-columns:1fr}
  .title{font-size:1.9rem}
  .nav-actions{gap:.4rem}
  .footer-grid{grid-template-columns:1fr}
}
