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

:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --dark-bg: #0f0c29;
  --paper-white: #fdfcf8;
  --paper-shadow: rgba(0, 0, 0, 0.3);
  --text-dark: #2d3748;
  --accent-gold: #d4af37;
}

body {
  font-family: "Inter", sans-serif;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  overflow-x: hidden;
  position: relative;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.container {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 3rem 2rem;
}

/* Header Styles */
.header {
  text-align: center;
  max-width: 900px;
  animation: fadeInDown 1s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.main-title {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: white;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  line-height: 1.4;
  font-weight: 700;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.main-title:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Paper Container */
.paper-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 0;
  animation: fadeInUp 1s ease-out 0.3s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.paper {
  position: relative;
  width: min(500px, 90vw);
  height: min(650px, 80vh);
  background: var(--paper-white);
  border-radius: 8px;
  box-shadow: 0 10px 60px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.1),
    inset 0 0 100px rgba(0, 0, 0, 0.02);
  transform-style: preserve-3d;
  transition: transform 0.6s ease, box-shadow 0.6s ease;
  animation: paperFloat 6s ease-in-out infinite;
}

@keyframes paperFloat {
  0%,
  100% {
    transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) translateY(0);
  }
  50% {
    transform: perspective(1000px) rotateX(-2deg) rotateY(2deg)
      translateY(-10px);
  }
}

.paper:hover {
  transform: perspective(1000px) rotateX(0deg) rotateY(0deg) scale(1.02);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.1),
    inset 0 0 100px rgba(0, 0, 0, 0.02);
  animation-play-state: paused;
}

.paper-texture {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 31px,
    rgba(200, 200, 200, 0.1) 31px,
    rgba(200, 200, 200, 0.1) 32px
  );
  pointer-events: none;
  border-radius: 8px;
}

.paper-content {
  position: relative;
  height: 100%;
  padding: 4rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Stamp */
.stamp {
  position: absolute;
  top: 2rem;
  right: 2rem;
  padding: 0.5rem 1.5rem;
  border: 3px solid var(--accent-gold);
  border-radius: 4px;
  color: var(--accent-gold);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 2px;
  transform: rotate(15deg);
  opacity: 0.6;
  animation: stampAppear 0.5s ease-out 1.5s both;
}

@keyframes stampAppear {
  from {
    opacity: 0;
    transform: rotate(15deg) scale(0);
  }
  to {
    opacity: 0.6;
    transform: rotate(15deg) scale(1);
  }
}

/* Certificate Text */
.certificate-text {
  font-family: "Caveat", cursive;
  font-size: clamp(3rem, 8vw, 5rem);
  color: var(--text-dark);
  text-align: center;
  margin-bottom: 4rem;
  line-height: 1.2;
  animation: writeText 2s ease-out 0.8s both;
}

@keyframes writeText {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Signature Line */
.signature-line {
  width: 200px;
  height: 2px;
  background: var(--text-dark);
  margin: 0 auto 0.5rem;
  animation: drawLine 1s ease-out 2s both;
}

@keyframes drawLine {
  from {
    width: 0;
  }
  to {
    width: 200px;
  }
}

.signature-label {
  font-size: 0.875rem;
  color: #666;
  font-style: italic;
  text-align: center;
  animation: fadeIn 0.5s ease-out 2.5s both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Footer */
.footer {
  text-align: center;
  animation: fadeInUp 1s ease-out 0.6s both;
}

.footer-text {
  font-family: "Inter", sans-serif;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  font-weight: 600;
  color: white;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  padding: 1.5rem 2.5rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 50px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  display: inline-block;
  transition: all 0.3s ease;
}

.footer-text:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

/* Floating Shapes */
.floating-shapes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(2px);
}

.shape-1 {
  width: 300px;
  height: 300px;
  top: 10%;
  left: 10%;
  animation: float1 20s ease-in-out infinite;
}

.shape-2 {
  width: 200px;
  height: 200px;
  top: 60%;
  right: 15%;
  animation: float2 15s ease-in-out infinite;
}

.shape-3 {
  width: 150px;
  height: 150px;
  bottom: 15%;
  left: 20%;
  animation: float3 18s ease-in-out infinite;
}

@keyframes float1 {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(50px, 100px) rotate(180deg);
  }
}

@keyframes float2 {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(-80px, -60px) rotate(-180deg);
  }
}

@keyframes float3 {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(30px, -50px) rotate(180deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 2rem 1rem;
  }

  .main-title {
    padding: 1.5rem;
    font-size: 1.5rem;
  }

  .paper-content {
    padding: 2rem 1.5rem;
  }

  .stamp {
    top: 1rem;
    right: 1rem;
    font-size: 0.75rem;
    padding: 0.4rem 1rem;
  }

  .certificate-text {
    margin-bottom: 3rem;
  }

  .footer-text {
    padding: 1rem 1.5rem;
  }
}
