/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inconsolata', monospace;
  background: hsl(248, 70%, 10%) url("assets/images/background-desktop.png") no-repeat center center;
  background-size: cover;
  color: hsl(0, 0%, 100%);
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

/* Pattern Background Elements */
.pattern-lines-top {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: -1;
  pointer-events: none;
}

.pattern-lines-top img {
  width: 100%;
  height: auto;
  opacity: 0.3;
  max-height: 200px;
  object-fit: cover;
  object-position: top;
}

.pattern-squiggly-bottom-left {
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: -1;
  pointer-events: none;
}

.pattern-squiggly-bottom-left img {
  height: auto;
  opacity: 0.4;
}

.pattern-squiggly-top-right {
  position: fixed;
  top: 0;
  right: 0;
  z-index: -1;
  pointer-events: none;
}

.pattern-squiggly-top-right img {
  height: auto;
  opacity: 0.4;
}

/* Desktop patterns by default */
.mobile-pattern {
  display: none;
}

.desktop-pattern {
  display: block;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

/* Form Section */
.form-section {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.header {
  margin-bottom: 3rem;
  padding-top: 2rem;
}

.logo-full {
  height: 40px;
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
}

.header h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, hsl(7, 86%, 67%), hsl(0, 0%, 100%));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.header p {
  font-size: 1.25rem;
  color: hsl(252, 6%, 83%);
  font-weight: 400;
}

/* Form Styles */
.ticket-form {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 2.5rem;
  text-align: left;
}

.form-group {
  margin-bottom: 2rem;
}

.form-group label {
  display: block;
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  color: hsl(0, 0%, 100%);
}

.form-group input[type="text"],
.form-group input[type="email"] {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1.125rem;
  font-family: 'Inconsolata', monospace;
  background: hsl(245, 19%, 35%);
  border: 2px solid transparent;
  border-radius: 8px;
  color: hsl(0, 0%, 100%);
  transition: all 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus {
  outline: none;
  border-color: hsl(7, 88%, 67%);
  background: hsl(245, 15%, 58%);
}

.form-group input[type="text"]:hover,
.form-group input[type="email"]:hover {
  background: hsl(245, 15%, 58%);
}

/* Upload Area */
.upload-area {
  position: relative;
  border: 2px dashed hsl(252, 6%, 83%);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.upload-area:hover {
  border-color: hsl(7, 88%, 67%);
  background: rgba(255, 255, 255, 0.02);
}

.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.upload-icon {
  width: 48px;
  height: 48px;
}

.upload-text {
  font-size: 1.125rem;
  color: hsl(252, 6%, 83%);
}

.upload-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}

.upload-preview img {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid hsl(252, 6%, 83%);
}

.preview-actions {
  display: flex;
  gap: 0.75rem;
}

.preview-btn {
  padding: 0.5rem 1rem;
  font-family: 'Inconsolata', monospace;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.remove-btn {
  background: hsl(7, 88%, 67%);
  color: white;
}

.remove-btn:hover {
  background: hsl(7, 71%, 60%);
}

.change-btn {
  background: rgba(255, 255, 255, 0.1);
  color: hsl(0, 0%, 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.change-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Submit Button */
.submit-btn {
  width: 100%;
  padding: 1.25rem;
  font-size: 1.25rem;
  font-weight: 700;
  font-family: 'Inconsolata', monospace;
  background: hsl(7, 88%, 67%);
  color: hsl(0, 0%, 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.submit-btn:hover {
  background: hsl(7, 71%, 60%);
  transform: translateY(-2px);
}

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

/* Error Messages */
.error-message {
  color: hsl(7, 88%, 67%);
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.error-message:before {
  content: "⚠";
}

.form-group input.error {
  border-color: hsl(7, 88%, 67%);
  background: rgba(255, 107, 107, 0.1);
}

/* Confirmation Section */
.confirmation-section {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.confirmation-content {
  position: relative;
}

.message-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.logo-mark {
  height: 32px;
  position: relative;
  z-index: 2;
}

.message-header .event-name {
  font-size: 1.5rem;
  font-weight: 700;
}

.confirmation-section h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.highlight {
  background: linear-gradient(135deg, hsl(7, 86%, 67%), hsl(0, 0%, 100%));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.email {
  color: hsl(7, 88%, 67%);
  font-weight: 500;
}

.confirmation-section p {
  font-size: 1.25rem;
  color: hsl(252, 6%, 83%);
  margin-bottom: 3rem;
}

/* Ticket Styles */
.ticket {
  background: url("assets/images/pattern-ticket.svg") no-repeat center;
  background-size: contain;
  width: 100%;
  max-width: 640px;
  height: 320px;
  margin: 0 auto;
  padding: 2.5rem 2rem 2rem 2rem;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.ticket-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;

}

.ticket-header .logo-and-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ticket-header img {
  height: 24px;
  width: 24px;
}

.ticket-header .event-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: hsl(0, 0%, 100%);
}

.event-details {
  font-size: 0.875rem;
  color: hsl(252, 6%, 83%);
  font-weight: 400;
  margin-top: -0.25rem;
}

.ticket-body {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 3rem;
  position: absolute;
  bottom: 2.5rem;
  left: 2rem;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: -40px;
}

.attendee-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 48px;
  margin-top: -17px;
}

.attendee-info .name {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: hsl(0, 0%, 100%);
  line-height: 1.2;
}

.attendee-info .handle {
  font-size: 0.875rem;
  color: hsl(252, 6%, 83%);
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1.2;
}

.attendee-info .handle::before {
  content: "";
  width: 16px;
  height: 16px;
  background: url("./assets/images/icon-github.svg") no-repeat center;
  background-size: contain;
}

.ticket-code {
  position: absolute;
  top: 50%;
  right: 2.5rem;
  transform: translateY(-50%) rotate(90deg);
  transform-origin: center;
  writing-mode: horizontal-tb;
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(252, 6%, 83%);
  letter-spacing: 0.2rem;
  opacity: 0.8;
  white-space: nowrap;
}

/* Ticket Actions */
.ticket-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  font-family: 'Inconsolata', monospace;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  min-width: 140px;
  justify-content: center;
}

.action-btn.primary {
  background: hsl(7, 88%, 67%);
  color: hsl(0, 0%, 100%);
}

.action-btn.primary:hover {
  background: hsl(7, 71%, 60%);
  transform: translateY(-2px);
}

.action-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: hsl(0, 0%, 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.action-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.action-btn.tertiary {
  background: transparent;
  color: hsl(252, 6%, 83%);
  border: 1px solid hsl(252, 6%, 83%);
}

.action-btn.tertiary:hover {
  background: rgba(255, 255, 255, 0.05);
  color: hsl(0, 0%, 100%);
  border-color: hsl(0, 0%, 100%);
}

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

.action-btn svg {
  flex-shrink: 0;
}

/* Print Styles */
@media print {
  body {
    background: white !important;
    color: black !important;
  }

  .container {
    max-width: none;
    padding: 0;
  }

  .form-section,
  .message-header,
  .confirmation-section h1,
  .confirmation-section p,
  .ticket-actions,
  .attribution {
    display: none !important;
  }

  .confirmation-section {
    display: block !important;
  }

  .ticket {
    background: white !important;
    border: 2px solid #333;
    color: black !important;
    margin: 0;
    page-break-inside: avoid;
  }

  .ticket * {
    color: black !important;
  }

  .event-details,
  .attendee-info .handle,
  .ticket-code {
    color: #666 !important;
  }
}

/* Attribution */
.attribution {
  text-align: center;
  margin-top: 3rem;
  padding: 2rem;
  font-size: 0.875rem;
  color: hsl(252, 6%, 83%);
}

.attribution a {
  color: hsl(7, 88%, 67%);
  text-decoration: none;
}

.attribution a:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    background-image: url("assets/images/background-mobile.png");
  }

  .container {
    padding: 1rem;
  }

  .header h1 {
    font-size: 2rem;
  }

  .confirmation-section h1 {
    font-size: 2rem;
  }

  .ticket-form {
    padding: 1.5rem;
  }

  .upload-preview img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
  }

  .preview-actions {
    gap: 0.5rem;
  }

  .preview-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
  }

  .ticket {
    height: 240px;
    padding: 1.5rem 1rem;
    max-width: 100%;
  }

  .ticket-header .logo-and-title {
    gap: 0.5rem;
    margin-top: 30px;
  }

  .ticket-header img {
    height: 20px;
    width: 20px;
  }

  .ticket-header .event-name {
    font-size: 1rem;
  }

  .event-details {
    font-size: 0.75rem;
  }

  .ticket-body {
    bottom: 2.75rem;
    left: 1rem;
    gap: 0.75rem;
    margin-top: -20px;
  }

  .avatar {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    margin-top: -40px;
  }

  .attendee-info {
    height: 36px;
  }

  .attendee-info .name {
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
  }

  .attendee-info .handle {
    font-size: 0.75rem;
    gap: 0.25rem;
  }

  .attendee-info .handle::before {
    width: 12px;
    height: 12px;
  }

  .ticket-code {
    font-size: 1rem;
    right: 1rem;
    letter-spacing: 0.1rem;
  }


  /* Mobile pattern visibility */
  .mobile-pattern {
    display: block;
  }

  .desktop-pattern {
    display: none;
  }

  /* Adjust pattern sizes for mobile */
  .pattern-squiggly-bottom-left img,
  .pattern-squiggly-top-right img {
    max-width: 200px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  body {
    background-image: url("assets/images/background-tablet.png");
  }
}