/* ==========================================================================
   ID Card Template Styles (5 Distinct Templates)
   Standard Physical Dimensions: CR80 (85.60mm x 53.98mm)
   Standard Screen Preview Scale: 504px x 318px (Portrait: 318px x 504px)
   ========================================================================== */

:root {
  --cr80-width: 504px;
  --cr80-height: 318px;
  --cr80-vert-width: 318px;
  --cr80-vert-height: 504px;
  --passport-width: 105px;
  --passport-height: 135px; /* 35mm x 45mm ratio = 7:9 */
}

/* Master Card Base Container */
.id-card {
  position: relative;
  width: var(--cr80-width);
  height: var(--cr80-height);
  box-sizing: border-box;
  background-color: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 14px 35px -6px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.08);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  user-select: none;
  transition: all 0.3s ease;
  transform-origin: center center;
}

/* Glossy Overlay effect (Toggleable) */
.id-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.02) 40%, rgba(0,0,0,0.03) 100%);
  pointer-events: none;
  border-radius: inherit;
  z-index: 10;
}

/* Shared Passport Photo Container */
.passport-photo-box {
  width: var(--passport-width);
  height: var(--passport-height);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #e2e8f0;
  box-sizing: border-box;
  flex-shrink: 0;
}

.passport-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   TEMPLATE 1: "Classic Academic" (Reference id_card_sample1.png Replica)
   ========================================================================== */
.id-card.template-1 {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #F8FAFC 0%, #E2E8F0 100%);
  border: 1px solid #CBD5E1;
}

/* Template 1 Header: Ocean Blue */
.template-1 .card-header {
  height: 72px;
  background: #1C6B99;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 12px;
  box-sizing: border-box;
  border-bottom: 2px solid #144e70;
}

.template-1 .logo-container {
  width: 54px;
  height: 54px;
  background: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

.template-1 .logo-container img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.template-1 .header-title-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.template-1 .institute-name {
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.template-1 .institute-subtitle {
  color: #E0F2FE;
  font-size: 10px;
  font-weight: 500;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Template 1 Main Body */
.template-1 .card-body {
  flex: 1;
  padding: 10px 16px 8px 16px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: linear-gradient(135deg, #f1f5f9 0%, #ffffff 50%, #e2e8f0 100%);
}

.template-1 .student-id-banner {
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  color: #475569;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px dashed #cbd5e1;
}

.template-1 .student-id-val {
  color: #0f172a;
  background: #ffffff;
  padding: 1px 8px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  font-family: monospace;
  font-size: 13px;
}

.template-1 .body-split {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
}

.template-1 .student-info-table {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.template-1 .info-row {
  display: flex;
  font-size: 11.5px;
  line-height: 1.35;
}

.template-1 .info-label {
  width: 62px;
  font-weight: 700;
  color: #334155;
  flex-shrink: 0;
}

.template-1 .info-sep {
  margin-right: 6px;
  font-weight: 700;
  color: #475569;
}

.template-1 .info-val {
  font-weight: 600;
  color: #0f172a;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.template-1 .info-row.address-row .info-val {
  -webkit-line-clamp: 2;
  font-size: 10.5px;
}

/* Template 1 Photo Frame (35mm x 45mm replica) */
.template-1 .passport-photo-box {
  border: 2.5px solid #1e293b;
  box-shadow: 0 3px 6px rgba(0,0,0,0.12);
  border-radius: 2px;
  margin-top: 2px;
}

/* Template 1 Footer: Deep Maroon */
.template-1 .card-footer {
  height: 38px;
  background: #5C1D24;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 16px;
  box-sizing: border-box;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  border-top: 2px solid #43141a;
}

.template-1 .footer-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.template-1 .footer-badge {
  background: #ffffff;
  color: #5C1D24;
  padding: 2px 7px;
  border-radius: 3px;
  font-weight: 800;
  font-size: 10.5px;
}


/* ==========================================================================
   TEMPLATE 2: "Modern Tech / Corporate"
   ========================================================================== */
.id-card.template-2 {
  display: flex;
  background: #ffffff;
  border: 1px solid #E2E8F0;
}

.template-2 .tech-sidebar {
  width: 65px;
  background: #0F172A;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 12px 6px;
  box-sizing: border-box;
  color: #38BDF8;
}

.template-2 .tech-sidebar .logo-container {
  width: 48px;
  height: 48px;
  background: #ffffff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2px;
}

.template-2 .tech-sidebar .logo-container img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.template-2 .vertical-brand-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 9px;
  letter-spacing: 2px;
  font-weight: 700;
  color: #94A3B8;
  text-transform: uppercase;
}

.template-2 .sidebar-tag {
  font-size: 8px;
  background: #0284C7;
  color: #ffffff;
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 800;
}

.template-2 .tech-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  box-sizing: border-box;
}

.template-2 .tech-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #0EA5E9;
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.template-2 .institute-name {
  font-size: 14px;
  font-weight: 800;
  color: #0F172A;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.template-2 .tech-chip {
  background: #E0F2FE;
  color: #0369A1;
  font-size: 9.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid #BAE6FD;
}

.template-2 .tech-body-split {
  display: flex;
  gap: 12px;
  flex: 1;
}

.template-2 .passport-photo-box {
  border: 2px solid #0EA5E9;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(14, 165, 233, 0.15);
}

.template-2 .tech-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.template-2 .student-name-box {
  margin-bottom: 4px;
}

.template-2 .student-name {
  font-size: 15px;
  font-weight: 800;
  color: #0F172A;
}

.template-2 .student-dept {
  font-size: 10.5px;
  color: #0284C7;
  font-weight: 600;
}

.template-2 .tech-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 10px;
  font-size: 10.5px;
}

.template-2 .tech-field {
  display: flex;
  flex-direction: column;
}

.template-2 .field-lbl {
  font-size: 8.5px;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
}

.template-2 .field-txt {
  font-size: 10.5px;
  font-weight: 600;
  color: #1E293B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.template-2 .tech-footer-strip {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #CBD5E1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.template-2 .mock-barcode {
  display: flex;
  gap: 1.5px;
  height: 20px;
  align-items: center;
}

.template-2 .barcode-line {
  background: #1E293B;
  height: 100%;
  width: 2px;
}
.template-2 .barcode-line.wide { width: 4px; }
.template-2 .barcode-line.thin { width: 1px; }

.template-2 .valid-tag {
  font-size: 9px;
  font-weight: 700;
  color: #475569;
}


/* ==========================================================================
   TEMPLATE 3: "Executive Vertical Badge" (CR80 Portrait 318px x 504px)
   ========================================================================== */
.id-card.template-3 {
  width: var(--cr80-vert-width);
  height: var(--cr80-vert-height);
  display: flex;
  flex-direction: column;
  background: #FAFAFA;
  border: 1px solid #E2E8F0;
}

/* Lanyard Slot Cutout Guide */
.template-3 .lanyard-slot {
  width: 44px;
  height: 7px;
  background: #E2E8F0;
  border-radius: 4px;
  margin: 6px auto 4px auto;
  border: 1px solid #CBD5E1;
}

.template-3 .vert-header {
  background: #1E3A8A;
  padding: 8px 12px 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  border-bottom: 3px solid #D97706;
}

.template-3 .logo-container {
  width: 46px;
  height: 46px;
  background: #ffffff;
  border-radius: 50%;
  border: 2px solid #D97706;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.template-3 .logo-container img {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
}

.template-3 .institute-name {
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.2;
}

.template-3 .institute-subtitle {
  color: #FDE68A;
  font-size: 9px;
  font-weight: 500;
  margin-top: 2px;
}

.template-3 .vert-body {
  flex: 1;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

.template-3 .passport-photo-box {
  width: 95px;
  height: 122px;
  border: 2.5px solid #D97706;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
  margin-bottom: 8px;
}

.template-3 .student-title-block {
  text-align: center;
  margin-bottom: 8px;
  width: 100%;
}

.template-3 .student-name {
  font-size: 14.5px;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.2;
}

.template-3 .student-id-pill {
  display: inline-block;
  background: #1E3A8A;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  margin-top: 3px;
  letter-spacing: 0.5px;
}

.template-3 .vert-details-table {
  width: 100%;
  font-size: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-top: 1px solid #E2E8F0;
  padding-top: 6px;
}

.template-3 .v-row {
  display: flex;
  justify-content: space-between;
}

.template-3 .v-label {
  font-weight: 700;
  color: #64748B;
}

.template-3 .v-val {
  font-weight: 600;
  color: #0F172A;
  text-align: right;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.template-3 .vert-footer {
  background: #0F172A;
  color: #E2E8F0;
  padding: 6px 12px;
  font-size: 9px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 2px solid #D97706;
}


/* ==========================================================================
   TEMPLATE 4: "Medical & Health Sciences"
   ========================================================================== */
.id-card.template-4 {
  display: flex;
  flex-direction: column;
  background: #F0FDFA;
  border: 1px solid #CCFBF1;
}

.template-4 .med-header {
  height: 65px;
  background: linear-gradient(90deg, #0284C7 0%, #0891B2 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  box-sizing: border-box;
  color: #ffffff;
  border-bottom: 2px solid #0369A1;
}

.template-4 .brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.template-4 .logo-container {
  width: 48px;
  height: 48px;
  background: #ffffff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2px;
}

.template-4 .logo-container img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.template-4 .institute-name {
  font-size: 13.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.template-4 .institute-subtitle {
  font-size: 9.5px;
  color: #BAE6FD;
}

.template-4 .blood-badge {
  background: #DC2626;
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  padding: 4px 8px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.4);
  letter-spacing: 0.5px;
}

.template-4 .med-body {
  flex: 1;
  display: flex;
  padding: 10px 16px 8px 16px;
  gap: 14px;
  box-sizing: border-box;
}

.template-4 .photo-column {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.template-4 .passport-photo-box {
  border: 2px solid #0891B2;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(8, 145, 178, 0.15);
}

.template-4 .verified-badge {
  margin-top: 4px;
  font-size: 8.5px;
  font-weight: 800;
  background: #0D9488;
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.template-4 .med-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}

.template-4 .candidate-name {
  font-size: 14.5px;
  font-weight: 800;
  color: #0F172A;
  border-bottom: 1.5px solid #99F6E4;
  padding-bottom: 2px;
  margin-bottom: 4px;
}

.template-4 .med-row {
  display: flex;
  font-size: 10.5px;
  line-height: 1.35;
}

.template-4 .m-lbl {
  width: 68px;
  font-weight: 700;
  color: #0E7490;
}

.template-4 .m-val {
  font-weight: 600;
  color: #1E293B;
  flex: 1;
}

.template-4 .med-footer {
  height: 36px;
  background: #E0F2FE;
  border-top: 1px solid #BAE6FD;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 9.5px;
  font-weight: 700;
  color: #0369A1;
}

.template-4 .signature-box {
  border-bottom: 1px solid #0369A1;
  padding-bottom: 1px;
  font-size: 9px;
  font-style: italic;
  font-weight: 600;
}


/* ==========================================================================
   TEMPLATE 5: "Dynamic Campus / Warm Beige Solid" (No Gradients)
   ========================================================================== */
.id-card.template-5 {
  display: flex;
  flex-direction: column;
  background: #F7F3EE; /* Classic Warm Linen Beige Surface */
  border: 1px solid #DDD1C2; /* Soft Beige Border */
  position: relative;
}

/* Remove any overlay gradient on Template 5 */
.id-card.template-5::after {
  display: none;
}

.template-5 .creative-header {
  height: 68px;
  background: #785D47; /* Solid Deep Warm Beige / Chestnut */
  border-bottom: 3px solid #D4B996; /* Solid Sand Accent Line */
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  box-sizing: border-box;
  color: #ffffff;
}

.template-5 .logo-container {
  width: 50px;
  height: 50px;
  background: #ffffff;
  border: 2px solid #D4B996;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(61, 46, 34, 0.15);
  flex-shrink: 0;
}

.template-5 .logo-container img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.template-5 .institute-name {
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #ffffff;
}

.template-5 .institute-subtitle {
  font-size: 9.5px;
  color: #F3E8DB; /* Soft Cream */
  font-weight: 500;
  margin-top: 2px;
}

.template-5 .creative-body {
  flex: 1;
  display: flex;
  padding: 10px 16px 8px 16px;
  gap: 14px;
  box-sizing: border-box;
  background: #F7F3EE; /* Solid Warm Beige Canvas */
}

.template-5 .passport-photo-box {
  border: 2.5px solid #785D47; /* Solid Deep Beige Border */
  background: #EAE3D9;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(61, 46, 34, 0.12);
}

.template-5 .creative-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.template-5 .top-tags {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.template-5 .c-id-pill {
  background: #785D47; /* Solid Warm Beige */
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.template-5 .c-name {
  font-size: 15px;
  font-weight: 800;
  color: #3D2E22; /* Solid Warm Espresso */
  margin: 3px 0;
  border-bottom: 1.5px solid #DDD1C2;
  padding-bottom: 2px;
}

.template-5 .c-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 8px;
  font-size: 10px;
}

.template-5 .c-item {
  display: flex;
  flex-direction: column;
}

.template-5 .c-lbl {
  font-size: 8px;
  font-weight: 700;
  color: #785D47; /* Solid Warm Beige Label */
  text-transform: uppercase;
}

.template-5 .c-val {
  font-weight: 600;
  color: #291E16; /* Solid Dark Neutral */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.template-5 .creative-footer {
  height: 34px;
  background: #544030; /* Solid Dark Mocha Beige */
  border-top: 2px solid #D4B996; /* Solid Accent */
  color: #F7F3EE;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 9.5px;
  font-weight: 700;
}

.template-5 .footer-accent {
  color: #E6D3BE; /* Solid Light Sand Beige */
}


