/* Neobrutalist Contact Modal - Video Game Theme */

/* Modal backdrop with blur */
.mario-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mario-modal-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

/* Neobrutalist Modal Container */
.mario-modal {
  position: fixed;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 500px;
  background: #FEFEFE;
  border: 5px solid #000;
  box-shadow: 8px 8px 0 0 #000;
  z-index: 9999;
  padding: 0;
  opacity: 0;
  transition: top 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.3s ease;
}

.mario-modal.active {
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 1;
  animation: modalBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.mario-modal.exiting {
  animation: modalExit 0.5s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards;
}

/* Question Block Header */
.mario-modal-header {
  background: #FFD700;
  border-bottom: 5px solid #000;
  padding: 2rem 2rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.mario-modal-header::before {
  content: '?';
  position: absolute;
  top: -20px;
  right: 20px;
  font-family: 'Press Start 2P', cursive;
  font-size: 8rem;
  color: rgba(0, 0, 0, 0.1);
  line-height: 1;
}

.mario-modal-header h2 {
  font-family: 'Press Start 2P', cursive;
  font-size: 1.5rem;
  line-height: 1.4;
  margin: 0 0 0.5rem 0;
  color: #000;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.mario-modal-header p {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.7rem;
  line-height: 1.6;
  margin: 0;
  color: #333;
  position: relative;
  z-index: 1;
}

/* Close Button - Styled like a coin */
.mario-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  background: #FFD700;
  border: 4px solid #000;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Press Start 2P', cursive;
  font-size: 1.2rem;
  color: #000;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 3px 3px 0 0 #000;
  z-index: 2;
}

.mario-modal-close:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: 4px 4px 0 0 #000;
}

.mario-modal-close:active {
  transform: scale(0.95);
  box-shadow: 2px 2px 0 0 #000;
}

/* Modal Body */
.mario-modal-body {
  padding: 2rem;
}

/* Form Styling - Neobrutalist */
.mario-contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.mario-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mario-form-group label {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.7rem;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.mario-form-group input,
.mario-form-group textarea {
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  padding: 1rem;
  background: #FFF;
  border: 4px solid #000;
  box-shadow: 4px 4px 0 0 rgba(0, 0, 0, 0.2);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  outline: none;
}

.mario-form-group input:focus,
.mario-form-group textarea:focus {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 0 rgba(255, 215, 0, 0.6);
  border-color: #FFD700;
}

.mario-form-group textarea {
  resize: vertical;
  min-height: 120px;
  font-family: 'Courier New', monospace;
}

/* Power-Up Block Submit Button */
.mario-submit-btn {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.9rem;
  padding: 1.2rem 2rem;
  background: #FF4444;
  color: #FFF;
  border: 5px solid #000;
  box-shadow: 6px 6px 0 0 #000;
  cursor: pointer;
  text-transform: uppercase;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.2s ease;
  position: relative;
  overflow: hidden;
}

.mario-submit-btn::before {
  content: '⭐';
  position: absolute;
  top: 50%;
  left: -30px;
  transform: translateY(-50%);
  font-size: 1.5rem;
  transition: left 0.3s ease;
}

.mario-submit-btn:hover {
  background: #FF6666;
  transform: translate(-3px, -3px);
  box-shadow: 9px 9px 0 0 #000;
}

.mario-submit-btn:hover::before {
  left: 10px;
}

.mario-submit-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 0 #000;
}

.mario-submit-btn:disabled {
  background: #999;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Success Message */
.mario-success-message {
  display: none;
  background: #00FF00;
  border: 4px solid #000;
  padding: 1.5rem;
  margin-top: 1rem;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.8rem;
  text-align: center;
  animation: successPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.mario-success-message.show {
  display: block;
}

/* Animations */
@keyframes modalBounce {
  0% {
    top: -100%;
    opacity: 0;
  }
  60% {
    top: 52%;
    opacity: 1;
  }
  80% {
    top: 48%;
  }
  100% {
    top: 50%;
  }
}

@keyframes modalExit {
  0% {
    top: 50%;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.05);
  }
  100% {
    top: -100%;
    opacity: 0;
    transform: translate(-50%, -100%) scale(0.8);
  }
}

@keyframes successPop {
  0% {
    transform: scale(0);
  }
  60% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* Pixel-perfect corners for extra retro feel */
.mario-modal,
.mario-form-group input,
.mario-form-group textarea,
.mario-submit-btn {
  border-radius: 0;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .mario-modal {
    width: 95%;
    max-width: none;
  }

  .mario-modal-header h2 {
    font-size: 1.2rem;
  }

  .mario-modal-header p {
    font-size: 0.6rem;
  }

  .mario-modal-body {
    padding: 1.5rem;
  }

  .mario-form-group label {
    font-size: 0.6rem;
  }

  .mario-submit-btn {
    font-size: 0.75rem;
    padding: 1rem 1.5rem;
  }
}

/* Add blur to Mario sticky when modal is active */
.mario-sticky.blurred {
  filter: blur(8px);
  transition: filter 0.3s ease;
}

/* Mobile Contact Button - appears at frame 95 */
.mario-mobile-contact-btn {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) scale(0);
  padding: 1rem 2rem;
  background: #FF4444;
  color: #FFF;
  border: 4px solid #000;
  box-shadow: 6px 6px 0 0 #000;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.8rem;
  cursor: pointer;
  z-index: 9997;
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), box-shadow 0.2s ease;
  opacity: 0;
  pointer-events: none;
}

.mario-mobile-contact-btn.show {
  transform: translateX(-50%) scale(1);
  opacity: 1;
  pointer-events: all;
}

.mario-mobile-contact-btn:active {
  transform: translateX(-50%) scale(0.95);
  box-shadow: 3px 3px 0 0 #000;
}

/* Hide mobile button on desktop */
@media (min-width: 1024px) {
  .mario-mobile-contact-btn {
    display: none;
  }
}

/* Mobile modal adjustments */
@media (max-width: 1023px) {
  .mario-modal {
    max-width: none;
    width: 80%;
  }

  .mario-modal-header::before {
    font-size: 6rem;
    right: 10px;
  }
}
