body {
  font-family: Arial, sans-serif;
  background: #f0f0f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

.form-container {
  margin: 20px 0;
  background: #fff;
  padding: 20px 30px;
  border-radius: 10px;
  box-shadow: 0 2px 8px #0001;
}

.form-container label {
  display: block;
  margin: 10px 0 5px;
}

.form-container input[type="text"], .form-container input[type="file"] {
  width: 100%;
  padding: 5px;
  margin-bottom: 10px;
}

.card-container {
  perspective: 1200px;
  margin-top: 20px;
}

.id-card {
  width: 340px;
  height: 540px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(.4, 2, .6, 1);
  margin-bottom: 10px;
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 9px;
  box-shadow: 0 4px 16px #0002;
  backface-visibility: hidden;
  overflow: hidden;
  padding: 0;
}

.card-front {
  z-index: 2;
}

.card-back {
  transform: rotateY(180deg);
  z-index: 1;
}

.flipped {
  transform: rotateY(180deg);
}

#flipBtn, #downloadBtn {
  padding: 8px 20px;
  font-size: 16px;
  border-radius: 6px;
  border: none;
  background: #00703c;
  color: #fff;
  cursor: pointer;
  margin: 5px;
}

#downloadBtn {
  background: #2c3e50;
}

#downloadBtn:hover {
  background: #34495e;
}

#flipBtn:hover {
  background: #005a30;
}

.pattern-box {
  /* border: 2px solid #008040; */
  border: 2px solid #ffffff;
  border-radius: 9px;
  /* margin: 18px; */
  padding: 0;
  background: #fff;
  box-shadow: 0 2px 8px #0001;
  height: 99%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pattern-header {
  text-align: center;
  padding: 10px 0 0 0;
}

.pattern-header .kiit-logo {
  width: 60px;
  vertical-align: middle;
}

.pattern-header .kiit-title {
  color: #008040;
  font-weight: bold;
  font-size: 18px;
  margin: 0;
}

.pattern-header .kiit-sub {
  font-size: 12px;
  color: #222;
  margin: 0;
}

.pattern-header .kiit-uni {
  font-size: 11px;
  color: #444;
  margin: 0;
}

.pattern-id {
  text-align: center;
  font-weight: bold;
  font-size: 15px;
  margin: 8px 0 0 0;
  letter-spacing: 1px;
}

.pattern-school {
  color: #e74c3c;
  font-weight: bold;
  font-size: 19px;
  text-align: center;
  margin: 5px 0 0 0;
}

.pattern-photo {
  display: flex;
  justify-content: center;
  align-items: center;
  /* margin: 10px 0 0 0; */
}

.pattern-photo-img {
  width: 198px;
  height: 187px;
  border: 2px solid #008040;
  border-radius: 4px;
  object-fit: fill;
  background: #eee;
}

.pattern-details {
  margin: 10px 30px 0 20px;
  font-size: 20px;
}

.pattern-details div {
  padding-bottom: 10px;
  /* font-weight: 900; */
}

.pattern-details .label {
  /* font-weight: bold; */
  width: 110px;
  display: inline-block;
  font-family: Georgia, 'Times New Roman', Times, serif;
}

.pattern-details .value {
  /* font-weight: bold; */
  padding-left: 5px;
  font-family: serif;
}

.pattern-sign {
  text-align: right;
  font-size: 15px;
  margin: 0px 20px 10px 0;
  color: #333;
}

.pattern-name {
  text-align: center;
  font-size: 20px;
  /* font-weight: bold; */
  margin: 10px 0 0 0;
  letter-spacing: 1px;
  font-family: Georgia, 'Times New Roman', Times, serif;
}

.card-back-content {
  padding: 20px 20px 0 20px;
  font-size: 16px;
}

.card-back-content div {
  padding-bottom: 5px;
}

.card-back-content .label {
  /* font-weight: bold; */
  width: 110px;
  display: inline-block;
  font-family: Georgia, 'Times New Roman', Times, serif;
}

.card-back-content .value{
  font-family: serif, Georgia, 'Times New Roman', Times;
}

.instructions {
  margin-top: 15px;
  font-size: 15px;
  text-align: center;
}

.instructions b {
  font-size: 20px;
  /* text-align: center; */
}

.instructions ul {
  padding-left: 25px;
  list-style: disc;
  margin-top: 0px;
}

.instructions ul li {
  padding-bottom: 10px;
  padding-left: 8px;
  text-align: justify;
}

.instructions ul li::marker {
  font-size: 1.6rem;
  color: black;
  vertical-align: bottom;
}

.barcode {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* margin-top: 18px; */
  padding-bottom: 0px !important;
}

.barcode-img {
  width: 265px;
  height: 80px;
  /* background: #eee; */
  margin-bottom: 4px;
}

#barcodeSvg text{
  font-family: serif, Georgia, 'Times New Roman', Times !important;
}

@media (max-width: 400px) {
  .id-card {
    width: 98vw;
    height: 70vw;
  }
}

.pattern-header-flex {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-top: 5px;
  padding-bottom: 5px;
  margin-bottom: 0;
  border-bottom: 1px solid #008040;
}

.pattern-logo-col {
  flex: 0 0 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 10px;
}

.pattern-univ-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  line-height: 1.1;
}

.pattern-univ-col .kiit-title {
  color: #008040;
  font-weight: bold;
  font-size: 15px;
  margin: 0;
}

.pattern-univ-col .kiit-sub {
  font-size: 15px;
  color: #222;
  margin: 0;
  font-weight: 600;
}

.pattern-univ-col .kiit-uni {
  font-size: 12px;
  color: #444;
  margin: 0;
}

.pattern-logo-col img {
  width: 106px;
}

.phfaxweb {
  font-size: 15px;
  margin-top: 10px;
  text-align: center;
  bottom: 15px;
  position: absolute;
}

.button-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 15px;
}

.button-group button {
  flex: 1;
  min-width: 120px;
  padding: 8px 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

#saveBtn {
  background-color: #2ecc71;
  color: white;
}

#saveBtn:hover {
  background-color: #27ae60;
}

#loadBtn {
  background-color: #3498db;
  color: white;
}

#loadBtn:hover {
  background-color: #2980b9;
}

#resetBtn {
  background-color: #e74c3c;
  color: white;
}

#resetBtn:hover {
  background-color: #c0392b;
}

/* Progress Bar Styles */
.progress-container {
  width: 100%;
  background-color: #f0f0f0;
  border-radius: 5px;
  margin: 15px 0;
  position: relative;
}

.progress-bar {
  width: 0%;
  height: 20px;
  background-color: #4CAF50;
  border-radius: 5px;
  transition: width 0.3s ease;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #000;
  font-size: 12px;
  font-weight: bold;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.7);
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 800px;
  border-radius: 10px;
  position: relative;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: black;
}

#previewContent {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

/* New Button Styles */
#previewBtn {
  background-color: #9b59b6;
  color: white;
}

#previewBtn:hover {
  background-color: #8e44ad;
}

#pdfBtn {
  background-color: #e67e22;
  color: white;
}

#pdfBtn:hover {
  background-color: #d35400;
}

/* Dark Theme Styles */
body.dark-theme {
  background: #121212;
  color: #e0e0e0;
}

body.dark-theme .form-container {
  background: #1e1e1e;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

body.dark-theme .form-container label {
  color: #e0e0e0;
}

body.dark-theme .form-container input[type="text"],
body.dark-theme .form-container input[type="file"] {
  background: #2d2d2d;
  color: #e0e0e0;
  border: 1px solid #444;
}

body.dark-theme .button-group button {
  background: #444;
  color: #e0e0e0;
}

body.dark-theme .button-group button:hover {
  background: #555;
}

body.dark-theme .progress-container {
  background: #2d2d2d;
}

body.dark-theme .progress-bar {
  background: #4CAF50;
}

body.dark-theme .progress-text {
  color: #e0e0e0;
}

body.dark-theme .modal-content {
  background: #1e1e1e;
  color: #e0e0e0;
}

body.dark-theme .close {
  color: #e0e0e0;
}

body.dark-theme .close:hover {
  color: #fff;
}

/* Theme Toggle Button Styles */
.theme-toggle {
  margin: 10px 0;
  padding: 8px 15px;
  background: #00703c;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.theme-toggle:hover {
  background: #005a30;
}