/* ========================================
   e-Salary Modern UI - custom stylesheet
   ======================================== */

/* Thai Google Font */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
  --primary:   #1a5276;
  --primary-light: #2980b9;
  --accent:    #f39c12;
  --accent-dark: #d68910;
  --success:   #27ae60;
  --danger:    #c0392b;
  --bg-light:  #f0f4f8;
  --card-shadow: 0 4px 24px rgba(0,0,0,.10);
  --radius: 12px;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Sarabun', 'Tahoma', sans-serif;
  background: var(--bg-light);
  color: #2c3e50;
  margin: 0;
  padding: 0;
}

/* ── Navbar ─────────────────────────────── */
.es-navbar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: 0;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.es-navbar .navbar-brand {
  color: #fff !important;
  font-weight: 700;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.es-navbar .nav-link {
  color: rgba(255,255,255,.88) !important;
  font-weight: 500;
  transition: color .2s;
}
.es-navbar .nav-link:hover,
.es-navbar .nav-link.active { color: #fff !important; }
.es-navbar .navbar-toggler {
  border-color: rgba(255,255,255,.5);
}
.es-navbar .navbar-toggler-icon {
  filter: invert(1);
}

/* ── Hero ────────────────────────────────── */
.es-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #154360 100%);
  padding: 110px 0 60px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.es-hero::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 60px;
  background: var(--bg-light);
  clip-path: ellipse(55% 100% at 50% 100%);
}
.es-hero h1 {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: .5rem;
}
.es-hero .badge-version {
  background: var(--accent);
  color: #fff;
  font-size: .75rem;
  border-radius: 20px;
  padding: .2rem .7rem;
  vertical-align: middle;
  margin-left: .5rem;
}
.es-hero p {
  font-size: 1rem;
  opacity: .9;
  max-width: 560px;
}
.es-hero-img {
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  max-width: 100%;
}

/* ── Cards ───────────────────────────────── */
.es-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 2rem;
  margin-bottom: 1.5rem;
}
.es-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.es-card-title i { color: var(--accent); }

/* ── Login Form ──────────────────────────── */
.es-login-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  padding: 2rem 2rem 1.5rem;
  margin-top: -30px;
  position: relative;
  z-index: 2;
}
.es-login-card .login-header {
  text-align: center;
  margin-bottom: 1.5rem;
}
.es-login-card .login-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto .75rem;
  box-shadow: 0 4px 12px rgba(41,128,185,.4);
}
.es-login-card .login-icon i { color: #fff; font-size: 1.6rem; }
.es-login-card h4 {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.15rem;
  margin-bottom: 0;
}
.es-login-card .form-label {
  font-weight: 600;
  font-size: .9rem;
  color: #5d6d7e;
}
.es-login-card .form-control {
  border-radius: 8px;
  border: 1.5px solid #d5d8dc;
  padding: .55rem .85rem;
  font-size: .95rem;
  transition: border-color .2s, box-shadow .2s;
}
.es-login-card .form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(41,128,185,.15);
}
.es-login-card .input-group-text {
  background: #f0f4f8;
  border-radius: 8px 0 0 8px;
  border: 1.5px solid #d5d8dc;
  border-right: none;
  color: var(--primary);
}
.es-login-card .input-group .form-control {
  border-radius: 0 8px 8px 0;
}
.btn-login {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
  padding: .65rem 1.5rem;
  font-size: 1rem;
  transition: opacity .2s, transform .1s;
  width: 100%;
}
.btn-login:hover { opacity: .9; transform: translateY(-1px); color: #fff; }
.btn-login:active { transform: translateY(0); }
.es-login-card .note {
  font-size: .8rem;
  color: #7f8c8d;
  background: #fef9e7;
  border-left: 3px solid var(--accent);
  padding: .5rem .75rem;
  border-radius: 4px;
  margin-top: 1rem;
}
.es-login-card .note b { color: #e74c3c; }

/* ── Section ─────────────────────────────── */
.es-section { padding: 2.5rem 0 1rem; }
.es-section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  position: relative;
  padding-bottom: .5rem;
  margin-bottom: 1.5rem;
}
.es-section-title::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 48px; height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* ── Screenshot Gallery ──────────────────── */
.ss-thumb {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  transition: transform .25s, box-shadow .25s;
  cursor: pointer;
  display: block;
}
.ss-thumb:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(0,0,0,.2);
}
.ss-thumb img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.ss-thumb .ss-overlay {
  background: linear-gradient(0deg, rgba(26,82,118,.75) 0%, transparent 60%);
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .25s;
  display: flex; align-items: flex-end; padding: .75rem;
}
.ss-thumb:hover .ss-overlay { opacity: 1; }
.ss-thumb .ss-overlay span { color: #fff; font-size: .85rem; font-weight: 600; }

/* ── Info Cards ──────────────────────────── */
.info-icon-card {
  text-align: center;
  padding: 1.5rem 1rem;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--card-shadow);
  height: 100%;
  transition: transform .2s;
}
.info-icon-card:hover { transform: translateY(-4px); }
.info-icon-card .icon-circle {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto .75rem;
  font-size: 1.4rem;
}
.info-icon-card h6 { font-weight: 700; color: var(--primary); }
.info-icon-card p { font-size: .85rem; color: #6c757d; margin: 0; }

/* ── Online indicator ────────────────────── */
.es-online-bar {
  background: #fff;
  border-radius: 8px;
  padding: .5rem 1rem;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  color: #5d6d7e;
}
.es-online-bar .dot {
  width: 8px; height: 8px;
  background: var(--success);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: .4; }
}

/* ── Footer ─────────────────────────────── */
.es-footer {
  background: linear-gradient(135deg, var(--primary) 0%, #154360 100%);
  color: rgba(255,255,255,.85);
  padding: 2rem 0 1rem;
  margin-top: 3rem;
  font-size: .88rem;
}
.es-footer a { color: rgba(255,255,255,.7); text-decoration: none; }
.es-footer a:hover { color: #fff; }
.es-footer .footer-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: .25rem;
}
.es-footer hr { border-color: rgba(255,255,255,.2); }
.es-footer .copy { font-size: .8rem; opacity: .6; }

/* ── Modal ───────────────────────────────── */
#imgModal .modal-body { padding: 0; }
#imgModal img { width: 100%; display: block; border-radius: var(--radius); }
#imgModal .modal-content { border: none; border-radius: var(--radius); overflow: hidden; }

/* ── Alerts ──────────────────────────────── */
.es-alert {
  border-radius: 8px;
  padding: .75rem 1rem;
  font-size: .9rem;
  margin-bottom: 1rem;
}

/* ── Utilities ───────────────────────────── */
.text-primary-es { color: var(--primary) !important; }
.bg-primary-es { background: var(--primary) !important; }
.fw-600 { font-weight: 600; }

/* ── Responsive ──────────────────────────── */
@media (max-width: 768px) {
  .es-hero { padding: 90px 0 50px; }
  .es-hero h1 { font-size: 1.5rem; }
  .es-login-card { margin-top: 0; }
}
