/* ========================================
   CERTIFICATE GENERATOR STYLES
   ======================================== */

/* Container */
.certificate-generator {
  background: linear-gradient(135deg, #F8F7FF 0%, #FFF8F8 50%, #F8FFFA 100%);
  padding: 40px 20px;
  min-height: 600px;
}

.cert-gen-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Buttons */
.cert-gen-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
  margin-bottom: 24px;
}

.cert-gen-btn {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: system-ui, -apple-system, sans-serif;
}

.cert-gen-btn--primary {
  background: linear-gradient(90deg, #7C3AED 0%, #E535AB 100%);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.cert-gen-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
}

.cert-gen-btn--social {
  background: linear-gradient(90deg, #EC4899 0%, #F472B6 100%);
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.cert-gen-btn--social:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(236, 72, 153, 0.4);
}

.cert-gen-btn--share {
  background: linear-gradient(90deg, #3B82F6 0%, #60A5FA 100%);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.cert-gen-btn--share:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.cert-gen-btn:disabled {
  background: #999;
  cursor: not-allowed;
  opacity: 0.7;
  transform: none !important;
}

/* Share Modal */
.cert-gen-share-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cert-gen-share-modal.active {
  display: flex;
}

.cert-gen-share-content {
  background: white;
  border-radius: 16px;
  padding: 32px;
  max-width: 400px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.cert-gen-share-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #666;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
}

.cert-gen-share-close:hover {
  color: #333;
}

.cert-gen-share-title {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #1A1A1A;
  margin: 0 0 24px 0;
  text-align: center;
}

.cert-gen-share-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cert-gen-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
  font-family: system-ui, -apple-system, sans-serif;
}

.cert-gen-share-btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.cert-gen-share-btn span {
  font-weight: 700;
  font-size: 16px;
}

.cert-gen-share-btn--twitter {
  background: #000000;
}

.cert-gen-share-btn--facebook {
  background: #1877F2;
}

.cert-gen-share-btn--linkedin {
  background: #0A66C2;
}

.cert-gen-share-btn--copy {
  background: linear-gradient(90deg, #7C3AED 0%, #9333EA 100%);
}

.cert-gen-share-tip {
  margin: 20px 0 0 0;
  font-size: 13px;
  color: #666;
  text-align: center;
  font-family: system-ui, -apple-system, sans-serif;
}

/* Layout */
.cert-gen-layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 1100px) {
  .cert-gen-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 600px) {
  .cert-gen-buttons {
    flex-direction: column;
  }
  
  .cert-gen-btn {
    width: 100%;
  }
  
  .cert-gen-form {
    padding: 20px;
  }
  
  .cert-gen-emoji-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .cert-gen-emoji-btn {
    font-size: 20px;
  }
}

@media (max-width: 400px) {
  .cert-gen-emoji-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Form Panel */
.cert-gen-form {
  background: white;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  overflow: hidden;
}

/* Form Elements */
.cert-gen-field {
  margin-bottom: 24px;
}

.cert-gen-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #666;
  margin-bottom: 8px;
  text-transform: uppercase;
  font-family: system-ui, -apple-system, sans-serif;
}

.cert-gen-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-family: Georgia, serif;
  border: 2px solid #E5E5E5;
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  background: white;
}

.cert-gen-input:focus {
  border-color: #7C3AED;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Certificate Type Buttons */
.cert-gen-type-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cert-gen-type-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid #E5E5E5;
  border-radius: 10px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  width: 100%;
  font-family: system-ui, -apple-system, sans-serif;
}

.cert-gen-type-btn:hover {
  border-color: #C4B5FD;
}

.cert-gen-type-btn.active {
  border-color: #7C3AED;
  background: linear-gradient(135deg, #F8F7FF 0%, #FFF8FF 100%);
}

.cert-gen-type-emoji {
  font-size: 24px;
}

.cert-gen-type-label {
  font-weight: 600;
  font-size: 14px;
  color: #1A1A1A;
}

.cert-gen-type-btn.active .cert-gen-type-label {
  color: #7C3AED;
}

.cert-gen-type-desc {
  font-size: 12px;
  color: #888;
}

.cert-gen-type-check {
  margin-left: auto;
  color: #7C3AED;
  font-size: 18px;
  display: none;
}

.cert-gen-type-btn.active .cert-gen-type-check {
  display: block;
}

/* Emoji Picker */
.cert-gen-emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  max-width: 100%;
}

.cert-gen-emoji-btn {
  width: 100%;
  aspect-ratio: 1;
  font-size: 24px;
  border: 2px solid #E5E5E5;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  min-width: 0;
}

.cert-gen-emoji-btn:hover {
  border-color: #C4B5FD;
  transform: scale(1.1);
}

.cert-gen-emoji-btn.active {
  border-color: #7C3AED;
  background: linear-gradient(135deg, #F8F7FF 0%, #FFF8FF 100%);
}

/* Custom Message */
.cert-gen-custom-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin-bottom: 12px;
}

.cert-gen-custom-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #7C3AED;
  cursor: pointer;
}

.cert-gen-custom-toggle label {
  font-size: 12px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: system-ui, -apple-system, sans-serif;
}

.cert-gen-textarea {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  font-family: Georgia, serif;
  border: 2px solid #E5E5E5;
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  resize: vertical;
  min-height: 100px;
  background: white;
}

.cert-gen-textarea:focus {
  border-color: #7C3AED;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.cert-gen-textarea:disabled {
  background: #f5f5f5;
  color: #999;
  cursor: not-allowed;
}

.cert-gen-char-count {
  font-size: 12px;
  color: #888;
  text-align: right;
  margin-top: 4px;
  font-family: system-ui, -apple-system, sans-serif;
}

/* Preview Panel */
.cert-gen-preview {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  overflow: hidden;
  min-width: 0;
}

.cert-gen-preview-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 79.1%;
  overflow: hidden;
}

.cert-gen-preview-wrapper .certificate {
  position: absolute;
  top: 0;
  left: 0;
  width: 900px;
  height: 712px;
  transform-origin: top left;
}

.cert-gen-hidden {
  display: none;
}

.cert-gen-export-hidden {
  position: absolute;
  left: -9999px;
  top: 0;
}

/* ========================================
   CERTIFICATE STYLES
   ======================================== */
.certificate {
  width: 900px;
  height: 712px;
  position: relative;
  background: #FDFCFA;
  overflow: hidden;
  font-family: Georgia, serif;
}

.certificate * {
  font-style: normal;
}

.sunburst {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.decor {
  position: absolute !important;
  z-index: 5 !important;
  line-height: 1 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.cert-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding-bottom: 80px; /* Account for footer/badge space */
  padding-top: 20px;
  box-sizing: border-box;
}

.cert-superhero {
  font-size: 60px;
  margin-bottom: 16px;
}

.cert-header {
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.35em;
  color: #9333EA;
  margin-bottom: 12px;
}

.cert-title {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 4px;
}

.cert-title-svg {
  height: 110px;
  display: block;
}

.cert-presented {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: #888;
  margin-top: 16px;
  margin-bottom: 8px;
}

.cert-name-line {
  width: 450px;
  border-bottom: 2px solid #1A1A1A;
  min-height: 36px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4px;
}

.cert-name {
  font-family: 'Poppins', sans-serif;
  font-weight: 300;
  font-size: 28px;
  color: #1A1A1A;
}

.cert-body {
  max-width: 580px;
  text-align: center;
  font-size: 15px;
  line-height: 1.6;
  color: #444;
  margin-top: 20px;
  font-style: italic;
}

.cert-tagline {
  margin-top: 20px;
  text-align: center;
  font-style: italic;
  font-size: 14px;
  color: #1A1A1A;
  font-weight: bold;
}

.cert-tagline div {
  margin-bottom: 10px;
}

.cert-tagline div:last-child {
  margin-bottom: 0;
}

.cert-tagline-highlight {
  color: #9333EA;
}

.cert-footer {
  position: absolute;
  bottom: 24px;
  left: 32px;
  right: 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.cert-footer-left,
.cert-footer-right {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #666;
  line-height: 1.5;
  font-style: normal;
}

.cert-footer-right {
  text-align: right;
}

.cert-badge {
  position: absolute;
  bottom: 70px;
  right: 40px;
  width: 80px;
  height: 80px;
  background: linear-gradient(145deg, #F5C842 0%, #D4972A 50%, #C4870A 100%);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(212, 151, 42, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.3);
  padding: 8px;
}

.cert-badge-trophy {
  width: 28px;
  height: 28px;
  margin-bottom: 2px;
}

.cert-badge-verified {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 9px;
  font-weight: 700;
  color: white;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.cert-badge-hero {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: white;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
