/* SiPH (Proud Point) Custom Styling */
@import url("https://fonts.googleapis.com/css?family=Sarabun:400,500,600&subset=thai");

body {
  background: #F5F3E8;
  font-family: 'Sarabun', 'Noto Sans Thai', sans-serif;
  margin: 0;
  padding: 0;
}
img {
  margin: auto;
}

.bg-defult {
  position: relative;
  min-height: 100vh;
  background: #F5F3E8;
}

.img-circle-top {
  position: fixed;
  width: 100%;
  z-index: -1;
}
.img-circle-bottom {
  position: fixed;
  width: 100%;
  bottom: 0;
  z-index: -1;
}

.fancybox-content .fancybox-close-small {
  background: url(../images/icon-close-red.png) 50% 50% / auto 40px no-repeat;
}
.content-code-detail--card {
  color: #1565C0;
}

/* ============================= login.php ============================= */
.content-login {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #F5F3E8;
  padding: 20px;
}

.content-login .img-circle-top,
.content-login .img-circle-bottom {
  display: none; /* Remove old HWH background elements */
}

.content-login .layout-login {
  background: transparent;
  text-align: center;
  max-width: 400px;
  width: 100%;
  padding: 40px 20px;
  margin: auto;
}

.content-login .layout-login .img {
  margin-bottom: 30px;
}

.content-login .layout-login .img img {
  max-width: 200px;
  width: auto;
  height: auto;
}

.content-login .layout-login .header {
  color: #1565C0;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 40px;
  text-align: center;
}

.content-login .layout-login .body .form .form-group.form-input {
  position: relative;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  background: white;
  border-radius: 25px;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.content-login .layout-login .body .form .form-input > div:first-child {
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
}

.content-login .layout-login .body .form .form-input > div:first-child img {
  width: 20px;
  height: 20px;
  opacity: 0.6;
  filter: invert(1);
}

.content-login .layout-login .body .form .form-input > div:last-child {
  flex: 1;
  padding-right: 20px;
}

.content-login .layout-login .body .form .form-input input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  color: #333;
  width: 100%;
  padding: 10px 0;
}

.content-login .layout-login .body .form .form-input input::placeholder {
  color: #999;
  font-size: 14px;
}

.content-login .layout-login .body .form .btn-submit {
  margin-top: 30px;
}

.content-login .layout-login .body .form .btn-submit button {
  background: #B8860B;
  color: white;
  border: none;
  border-radius: 25px;
  padding: 15px 40px;
  font-size: 16px;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.content-login .layout-login .body .form .btn-submit button:hover {
  background: #A0750A;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(184, 134, 11, 0.3);
}

.content-login .layout-login .body .form .btn-submit button:disabled {
  background: #CCC;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.content-login .layout-login.active .body .form .btn-submit button {
  background: #B8860B;
}

/* ============================= Main Content ============================= */
.content-home {
  background: #F5F3E8;
  min-height: 100vh;
  padding: 20px;
}

.layout-logout {
  margin-bottom: 20px;
}

.layout-logout .btn-logout {
  background: #1565C0;
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}

.head {
  text-align: center;
  margin-bottom: 15px;
}

.head .name {
  color: #333;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 5px;
  text-align: left;
}

.head .date {
  color: #666;
  font-size: 14px;
  text-align: left;
}

.card {
  background: white;
  border-radius: 16px;
  padding: 30px 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  text-align: center;
  transition: transform 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card .img-exchnge,
.card .img-history {
  margin-bottom: 20px;
}

.card .img-exchnge img,
.card .img-history img {
  max-width: 80px;
  width: auto;
  height: auto;
}

.card .title {
  color: #1565C0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

/* ============================= QR Scanning ============================= */
.content-scan-code {
  background: #F5F3E8;
  min-height: 100vh;
  padding: 20px;
}

.content-scan-code .head {
  text-align: left;
  margin-bottom: 15px;
  margin-top: 15px;
}

.content-scan-code .head .title {
  color: #1565C0;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.content-scan-code .head .des {
  color: #666;
  font-size: 14px;
}

.content-scan {
  background: #666;
  border-radius: 12px;
  position: relative;
  min-height: calc(100vh - 150px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  overflow: hidden;
}

#video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
}

.scan-status {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 16px;
  z-index: 10;
  background: rgba(0,0,0,0.5);
  padding: 8px 16px;
  border-radius: 20px;
}

.restart-btn {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: #1565C0;
  color: white;
  border: none;
  border-radius: 25px;
  padding: 12px 20px;
  font-size: 16px;
  cursor: pointer;
  z-index: 10;
}

.restart-btn:hover {
  background: #0D47A1;
}

/* Success/Error Modals */
.popup-success-redeem,
.popup-cancle-msg {
  background: white;
  border-radius: 16px;
  padding: 30px;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.popup-icon {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.popup-icon img {
  width: 60px;
  height: 60px;
}

.popup-title {
  color: #333;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
}

.popup-subtitle {
  color: #666;
  font-size: 14px;
  margin-bottom: 20px;
}

.content-submit {
  margin-top: 20px;
}

.content-submit .content-submit--txtSubmit {
  color: white;
  padding: 12px 40px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  display: inline-block;
  transition: all 0.3s ease;
  min-width: 120px;
  border: none;
  font-size: 16px;
}

.success-btn {
  background: #28A745;
}

.success-btn:hover {
  background: #218838;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.error-btn {
  background: #FF6B35;
}

.error-btn:hover {
  background: #E55A2B;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

/* History Page */
.content-history {
  background: #F5F3E8;
  min-height: 100vh;
  padding: 20px;
}

.history-tabs {
  display: flex;
  margin-bottom: 20px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.history-tab {
  flex: 1;
  padding: 12px 20px;
  text-align: center;
  background: white;
  color: #666;
  cursor: pointer;
  border: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.history-tab.active {
  background: #1565C0;
  color: white;
}

.history-title {
  color: #1565C0;
  font-size: 24px;
  text-align: left;
  font-weight: bold;
  line-height: normal;
  margin-top: 20px;
}
.history-description {
  color: #1565C0;
  font-size: 14px;
  margin-bottom: 20px;
  text-align: left;
}

.history-count {
  color: #1565C0;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 15px;
  padding: 0 5px;
}

.history-item {
  background: white;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.history-item-date {
  color: #1565C0;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 3px;
}

.history-item-time {
  color: #1565C0;
  font-size: 12px;
  margin-bottom: 8px;
}

.history-item-title {
  color: #1565C0;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
}

.history-item-subtitle {
  color: #1565C0;
  font-size: 14px;
  margin-bottom: 2px;
}

/* Summary View */
.history-summary {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #E0E0E0;
}

.summary-title {
  color: #1565C0;
  font-size: 16px;
  font-weight: 600;
}

.summary-count {
  color: #1565C0;
  font-size: 14px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #F0F0F0;
}

.summary-item:last-child {
  border-bottom: none;
}

.summary-name {
  color: #333;
  font-size: 14px;
  flex: 1;
}

.summary-number {
  color: #333;
  font-size: 16px;
  font-weight: 600;
  min-width: 30px;
  text-align: right;
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  .content-login {
    padding: 15px;
  }

  .content-login .layout-login {
    padding: 20px 15px;
    max-width: 350px;
  }

  .content-login .layout-login .img img {
    max-width: 150px;
  }

  .content-login .layout-login .header {
    font-size: 16px;
    margin-bottom: 30px;
  }

  .content-home {
    padding: 15px;
  }

  .head .name {
    font-size: 18px;
  }

  .head .date {
    font-size: 13px;
  }

  .card {
    padding: 25px 15px;
    margin-bottom: 15px;
  }

  .card .title {
    font-size: 15px;
  }

  .content-scan-code,
  .content-history {
    padding: 15px;
  }

  .content-scan-code .head .title {
    font-size: 16px;
  }

  .content-scan-code .head .des {
    font-size: 13px;
  }

  /* .content-scan {
    min-height: 300px;
    border-radius: 12px;
  } */

  .scan-status {
    font-size: 14px;
    padding: 6px 12px;
  }

  .restart-btn {
    bottom: 15px;
    left: 15px;
    right: 15px;
    padding: 10px 16px;
    font-size: 15px;
  }

  .popup-success-redeem,
  .popup-cancle-msg {
    padding: 25px 20px;
    margin: 20px;
  }

  .popup-title {
    font-size: 16px;
  }

  .popup-subtitle {
    font-size: 13px;
  }

  .content-submit .content-submit--txtSubmit {
    padding: 10px 30px;
    font-size: 15px;
  }

  .history-tab {
    padding: 10px 15px;
    font-size: 13px;
  }

  .history-description {
    font-size: 13px;
    margin-bottom: 15px;
  }

  .history-item {
    padding: 12px;
    margin-bottom: 12px;
  }

  .history-summary {
    padding: 15px;
  }

  .summary-header {
    margin-bottom: 12px;
  }

  .summary-title {
    font-size: 15px;
  }

  .summary-item {
    padding: 8px 0;
  }

  .summary-name {
    font-size: 13px;
  }

  .summary-number {
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .content-login .layout-login {
    max-width: 300px;
    padding: 15px 10px;
  }

  .content-login .layout-login .img img {
    max-width: 120px;
  }

  .content-login .layout-login .header {
    font-size: 15px;
  }

  .card .img-exchnge img,
  .card .img-history img {
    max-width: 60px;
  }

  .popup-success-redeem,
  .popup-cancle-msg {
    padding: 20px 15px;
    margin: 15px;
  }

  .history-item {
    padding: 10px;
  }

  .history-summary {
    padding: 12px;
  }
}