/* Certificate Styles */
:root {
  --primary-color: #1a3a52;      /* Navy blue */
  --secondary-color: #c9a227;     /* Gold */
  --accent-color: #2c5f7c;        /* Lighter navy */
  --text-color: #2c3e50;          /* Dark text */
  --bg-cream: #fefcf3;            /* Cream background */
  --bg-ivory: #fffff0;            /* Ivory */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Sarabun', sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.certificate-wrapper {
  width: 100%;
  max-width: 1000px;
}

.certificate {
  background: white;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  position: relative;
}

.certificate-border {
  position: relative;
  padding: 60px;
  background: var(--bg-cream);
  border: 8px double var(--primary-color);
  overflow: hidden;
}

/* Ornate Corners */
.corner {
  position: absolute;
  width: 100px;
  height: 100px;
  border: 4px solid var(--secondary-color);
}

.corner::before,
.corner::after {
  content: '';
  position: absolute;
  background: var(--secondary-color);
}

.corner.top-left {
  top: 20px;
  left: 20px;
  border-right: none;
  border-bottom: none;
}

.corner.top-left::before {
  width: 60px;
  height: 4px;
  top: 30px;
  left: 0;
}

.corner.top-left::after {
  width: 4px;
  height: 60px;
  top: 0;
  left: 30px;
}

.corner.top-right {
  top: 20px;
  right: 20px;
  border-left: none;
  border-bottom: none;
}

.corner.top-right::before {
  width: 60px;
  height: 4px;
  top: 30px;
  right: 0;
}

.corner.top-right::after {
  width: 4px;
  height: 60px;
  top: 0;
  right: 30px;
}

.corner.bottom-left {
  bottom: 20px;
  left: 20px;
  border-right: none;
  border-top: none;
}

.corner.bottom-left::before {
  width: 60px;
  height: 4px;
  bottom: 30px;
  left: 0;
}

.corner.bottom-left::after {
  width: 4px;
  height: 60px;
  bottom: 0;
  left: 30px;
}

.corner.bottom-right {
  bottom: 20px;
  right: 20px;
  border-left: none;
  border-top: none;
}

.corner.bottom-right::before {
  width: 60px;
  height: 4px;
  bottom: 30px;
  right: 0;
}

.corner.bottom-right::after {
  width: 4px;
  height: 60px;
  bottom: 0;
  right: 30px;
}

/* Background Pattern */
.background-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.03;
  background-image: 
    repeating-linear-gradient(45deg, var(--primary-color) 0, var(--primary-color) 2px, transparent 2px, transparent 10px),
    repeating-linear-gradient(-45deg, var(--primary-color) 0, var(--primary-color) 2px, transparent 2px, transparent 10px);
  pointer-events: none;
  z-index: 0;
}

/* Certificate Content */
.certificate-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

/* Header */
.certificate-header {
  margin-bottom: 50px;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

.logo-icon {
  font-size: 3.5rem;
}

.organization-name {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: 0.1em;
}

.certificate-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--secondary-color);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid var(--secondary-color);
  display: inline-block;
}

/* Body */
.certificate-body {
  margin: 50px 0;
}

.certificate-intro {
  font-size: 1.1rem;
  color: var(--text-color);
  margin-bottom: 15px;
}

.recipient-name {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 30px 0;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--secondary-color);
  display: inline-block;
}

.certificate-text {
  font-size: 1.1rem;
  color: var(--text-color);
  margin-bottom: 15px;
}

.course-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--accent-color);
  line-height: 1.4;
  margin: 30px 0;
}

.certificate-date {
  font-size: 1.1rem;
  color: var(--text-color);
  margin-top: 30px;
}

/* Footer */
.certificate-footer {
  margin-top: 60px;
}

.signature-section {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-bottom: 30px;
}

.signature {
  text-align: center;
}

.signature-line {
  width: 250px;
  height: 2px;
  background: var(--primary-color);
  margin: 0 auto 10px;
}

.signature-text {
  font-size: 0.9rem;
  color: var(--text-color);
  font-style: italic;
}

/* Seal */
.seal {
  width: 120px;
  height: 120px;
  border: 6px double var(--secondary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(201, 162, 39, 0.1) 0%, transparent 70%);
  position: relative;
}

.seal::before {
  content: '';
  position: absolute;
  width: 140px;
  height: 140px;
  border: 2px solid var(--secondary-color);
  border-radius: 50%;
  opacity: 0.3;
}

.seal-content {
  text-align: center;
}

.seal-text {
  font-family: 'Playfair Display', serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--secondary-color);
  text-transform: uppercase;
}

.seal-year {
  font-size: 0.8rem;
  color: var(--secondary-color);
  font-weight: 600;
}

.certificate-id {
  font-size: 0.85rem;
  color: var(--text-color);
  font-style: italic;
  opacity: 0.7;
}

/* Certificate ID Display (Header) */
.certificate-id-display {
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  color: var(--text-color);
  margin-top: 15px;
  letter-spacing: 2px;
  font-weight: 400;
}

.certificate-id-display span {
  color: var(--accent-color);
  font-weight: 600;
}

/* Company Name */
.company-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 20px 0;
}

/* Certificate Meta (Footer) */
.certificate-meta {
  margin-top: 20px;
  font-size: 0.95rem;
  color: var(--text-color);
}

.certificate-meta p {
  margin: 5px 0;
}

.certificate-meta span {
  font-weight: 600;
  color: var(--accent-color);
}

/* Responsive */
@media (max-width: 768px) {
  .certificate-border {
    padding: 40px 30px;
  }
  
  .recipient-name {
    font-size: 2rem;
  }
  
  .course-name {
    font-size: 1.4rem;
  }
  
  .organization-name {
    font-size: 2rem;
  }
  
  .certificate-title {
    font-size: 1.5rem;
    letter-spacing: 0.1em;
  }
}

@media (max-width: 480px) {
  .certificate-border {
    padding: 30px 20px;
  }
  
  .recipient-name {
    font-size: 1.5rem;
  }
  
  .logo-icon {
    font-size: 2.5rem;
  }
  
  .corner {
    width: 60px;
    height: 60px;
  }
}

/* Test Form Styles */
.form-container {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  max-width: 600px;
  margin: 40px auto;
}

.form-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 30px;
  text-align: center;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: 'Sarabun', sans-serif;
  transition: border-color 0.3s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.btn-submit {
  width: 100%;
  padding: 14px 24px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
  font-family: 'Sarabun', sans-serif;
}

.btn-submit:hover {
  background: var(--accent-color);
}

/* Save Button Styles */
.btn-save {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    font-family: 'Sarabun', sans-serif;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-save:active {
    transform: translateY(0);
}

.button-container {
    margin-bottom: 40px;
}

@media print {
    .btn-save {
        display: none !important;
    }
    
    .button-container {
        display: none !important;
    }
}
