* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #eef2f5;
  margin: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Control Panel Styling */
.input-controls {
  background: #ffffff;
  padding: 24px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 800px;
  margin-bottom: 30px;
}

.input-controls h2 {
  margin-top: 0;
  font-size: 1.2rem;
  color: #1a202c;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 8px;
}

.input-group {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
}

.input-group label {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 0.85rem;
  color: #4a5568;
}

.input-group input, 
.input-group select,
.input-group textarea {
  padding: 8px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
}

button {
  background-color: #1a365d;
  color: #ffffff;
  border: none;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  margin-top: 10px;
}

button:hover {
  background-color: #2c5282;
}

/* Landscape Printable Container */
.landscape-cert {
  width: 297mm;
  height: 210mm;
  padding: 18mm 22mm;
  background-color: #ffffff;
  border: 1px solid #cbd5e0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Header */
.cert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cert-logo {
  height: 65px;
  width: auto;
  object-fit: contain;
}

.header-text {
  text-align: center;
}

.header-text h1 {
  margin: 0;
  font-size: 1.6rem;
  color: #0f172a;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.sub-title {
  margin: 4px 0 0;
  font-size: 0.95rem;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.divider {
  border-top: 2px solid #0f172a;
  margin: 12px 0 20px;
}

/* Main Body Content */
.cert-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

#certText {
  font-size: 1.15rem;
  line-height: 1.7;
  color: #1e293b;
  margin-bottom: 20px;
}

#displayDate {
  font-weight: 700;
  color: #0f172a;
  border-bottom: 1px solid #94a3b8;
  padding: 0 4px;
}

.item-display-container {
  width: 100%;
  margin-top: 5px;
}

/* Table Layout for Multiple Items */
.item-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.item-table th, 
.item-table td {
  border: 1px solid #cbd5e0;
  padding: 8px 12px;
  font-size: 0.95rem;
  text-align: left;
}

.item-table th {
  background-color: #f8fafc;
  color: #334155;
  font-weight: 600;
}

.single-item-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: #0f172a;
  padding: 8px 0;
}

/* Signatures */
.cert-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 20px;
}

.signature-block {
  width: 240px;
  text-align: center;
}

.sig-space {
  height: 45px;
}

.sig-line {
  border-bottom: 1px solid #334155;
  margin-bottom: 6px;
}

.sig-title {
  margin: 0;
  font-weight: 600;
  font-size: 0.9rem;
  color: #0f172a;
}

.sig-sub {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: #64748b;
}

/* Print Specifications */
@media print {
  body {
    background: none;
    padding: 0;
  }
  .input-controls {
    display: none !important;
  }
  .landscape-cert {
    box-shadow: none;
    border: none;
    width: 100vw;
    height: 100vh;
  }
  @page {
    size: A4 landscape;
    margin: 0;
  }
}