/* Vintage State-of-Art CSS for Part Submission Form */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Work+Sans:wght@300;400;500;600&display=swap');

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

:root {
  /* Color Palette - Based on the CMS Logo */
  --primary: #6BCBB8;        /* Mint green from logo */
  --primary-dark: #50A396;   /* Darker mint */
  --primary-light: #8CDECF;  /* Lighter mint */
  --secondary: #374151;      /* Keeping dark gray */
  --secondary-light: #4B5563;
  --background: #FFF9D6;     /* Light cream from logo */
  --paper: #FFFDED;          /* Slightly whiter cream */
  --text: #1F2937;
  --text-light: #6B7280;
  --border: #D9E5E2;
  --error: #EF4444;
  --success: #10B981;
  --purp: #d7b0ff;
  --dark: #a179ff; 
}

body {
  font-family: 'Work Sans', sans-serif;
  color: var(--text);
  background-color: var(--purp);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column; /* Changed from default to column */
  align-items: stretch; /* Changed from center to stretch */
  padding: 0px;
  position: relative;
  overflow-x: hidden;
}

/* Navigation styling for form page */
.main-nav {
  width: 100%;
  align-self: flex-start; /* Position nav at the top */
  margin-bottom: 20px; /* Space between nav and form */
}

/* Background Pattern */
.background-pattern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgb(47, 41, 63), rgb(45, 23, 60)),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%236bcbb8' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  z-index: -1;
  opacity: 0.8;
}

/* Main Container */
.container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  display: flex;
  justify-content: center; /* Added to center the form container */
}

/* Form Container */
.form-container {
  background-color: var(--paper);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1), 
              0 1px 8px rgba(0, 0, 0, 0.07), 
              0 0 1px rgba(0, 0, 0, 0.05);
  padding: 3rem;
  margin: 2rem 0;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(188, 138, 95, 0.2);
  background-image: 
    linear-gradient(to right, rgba(188, 138, 95, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(188, 138, 95, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  width: 100%; /* Ensure it takes full width of container */
}

.form-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(to right, var(--primary), var(--primary-light));
}

.logo {
  margin: 0 auto 1rem;
  display: flex;
  justify-content: center;
  max-width: 120px;
}

/* Form Header */
.form-header {
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
  padding-bottom: 1.5rem;
}

.form-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: var(--primary);
  border-radius: 3px;
}

.logo {
  margin: 0 auto 1rem;
  display: flex;
  justify-content: center;
}

.form-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
  font-weight: 700;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text);
  font-weight: 300;
}

/* Form Sections */
.form-section {
  margin-bottom: 2.5rem;
  padding: 2rem;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  border: 1px solid rgba(188, 138, 95, 0.1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
  position: relative;
}

.form-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--secondary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary-light);
  font-weight: 700;
}

/* Form Groups and Inputs */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--secondary);
  font-size: 0.95rem;
}

.input-wrapper {
  position: relative;
  margin-bottom: 0.5rem;
}

input, textarea, select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: 'Work Sans', sans-serif;
  font-size: 1rem;
  background-color: white;
  color: var(--text);
  transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(188, 138, 95, 0.2);
}

.input-focused {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.required {
  color: var(--error);
  margin-left: 0.25rem;
}

.error-message {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 0.25rem;
  font-weight: 500;
}

/* Name Fields */
.name-fields {
  display: flex;
  gap: 1rem;
}

.name-fields .input-wrapper {
  flex: 1;
}

/* Radio Buttons */
.radio-group {
  margin-top: 0.5rem;
}

.radio-option {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.radio-option:hover {
  background-color: rgba(188, 138, 95, 0.05);
}

.radio-option.radio-checked {
  background-color: rgba(188, 138, 95, 0.1);
}

.radio-option input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-right: 0.75rem;
  accent-color: var(--primary);
  cursor: pointer;
}

.radio-option label {
  margin-bottom: 0;
  cursor: pointer;
}

.other-option {
  display: flex;
  align-items: center;
}

.other-input {
  width: auto;
  flex: 1;
  margin-left: 0.75rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
}

/* Conditional Fields */
.hidden {
  display: none;
}

.conditional-fields {
  margin-top: 1rem;
  padding-left: 2rem;
  border-left: 2px dashed var(--primary-light);
}

/* File Upload */
.file-upload {
  border: 2px dashed var(--border);
  border-radius: 6px;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  background-color: white;
  position: relative;
}

.file-upload:hover {
  border-color: var(--primary-light);
}

.file-upload.highlight {
  border-color: var(--primary);
  background-color: rgba(188, 138, 95, 0.05);
}

.file-upload-icon {
  width: 48px;
  height: 48px;
  color: var(--primary);
  margin: 0 auto 1rem;
}

.file-upload-text {
  margin-bottom: 0.5rem;
}

.file-upload-label {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border: 1px solid var(--primary);
  border-radius: 4px;
  display: inline-block;
  margin-right: 0.5rem;
  transition: all 0.2s ease;
}

.file-upload-label:hover {
  background-color: var(--primary);
  color: white;
}

.hidden-input {
  display: none;
}

.file-upload-hint {
  font-size: 0.8rem;
  color: var(--text-medium);
  margin-top: 0.75rem;
}

.file-name {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 500;
}

.file-selected {
  color: var(--primary-dark);
}

/* Materials */

.materials-container {
  margin-bottom: 1rem;
}

.material-input {
  margin-bottom: 0.75rem;
}

.add-material-button {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  padding: 0.5rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.add-material-button:hover {
  background-color: rgba(188, 138, 95, 0.1);
}

.plus-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  background-color: var(--primary);
  color: white;
  border-radius: 50%;
  margin-right: 0.5rem;
  text-align: center;
  line-height: 18px;
}
/* Material remove button styles */
.material-input {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
  }
  
  .material-input input {
    flex: 1;
  }
  
  .remove-material-button {
    background: var(--error);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  .remove-material-button:hover {
    background-color: #DC2626;
    transform: scale(1.1);
  }
  
  /* Start over button styles */
  .success-message p {
    color: var(--text-light);
    font-size: 1.1rem;
    font-weight: 300;
    margin-bottom: 2rem;
  }
  
  .start-over-button {
    background-color: var(--primary);
    color: white;
    margin: 0 auto;
    display: inline-block;
  }
  
  .start-over-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(80, 163, 150, 0.3);
  }
/* Quantity Control */
.quantity-control {
  display: flex;
  align-items: center;
  width: max-content;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.quantity-button {
  width: 36px;
  height: 36px;
  background-color: white;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--primary-dark);
}

.quantity-button:hover {
  background-color: var(--primary-light);
  color: white;
}

.quantity-input {
  width: 60px;
  height: 36px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 0;
  font-size: 1rem;
}

.quantity-input::-webkit-inner-spin-button,
.quantity-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Select Dropdown */
.select-wrapper {
  position: relative;
}

.select-wrapper select {
  appearance: none;
  cursor: pointer;
}

.select-arrow {
  position: absolute;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--primary);
  pointer-events: none;
}

/* Position the Next button on the right */
.buttons-container {
  display: flex;
  justify-content: flex-end; /* Change from space-between to flex-end */
  margin-top: 2rem;
}

/* When there are multiple buttons (like on page 2), we need different styling */
#page2 .buttons-container {
  justify-content: space-between; /* Keep space-between for page 2 buttons */
}

/* Optional: Add a little margin to the Next button for better spacing */
.next-button {
  margin-left: auto; /* This pushes the button to the right */
}

.button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-family: 'Work Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
}


.next-button, .submit-button {
  background-color: var(--primary);
  color: white;
}

.next-button:hover, .submit-button:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(140, 101, 72, 0.3);
}

.back-button {
  background-color: white;
  color: var(--secondary);
  border: 1px solid var(--border);
}

.back-button:hover {
  background-color: var(--secondary-light);
  color: white;
  border-color: var(--secondary-light);
}

.arrow {
  font-size: 1.25rem;
  line-height: 1;
  margin: 0 0.5rem;
}

/* Page Transitions */
.form-page {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.fade-in {
  animation: fadeIn 0.3s forwards;
}

.fade-out {
  animation: fadeOut 0.3s forwards;
}

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

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

/* Success Message */
.success-message {
  text-align: center;
  padding: 3rem 2rem;
}

.success-message h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--primary-dark);
  margin: 1.5rem 0 1rem;
}

.success-message p {
  color: var(--text-light);
  font-size: 1.1rem;
  font-weight: 300;
}

/* Checkmark Animation */
.checkmark {
  width: 80px;
  height: 80px;
  margin: 0 auto;
}

.checkmark-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 3;
  stroke-miterlimit: 10;
  stroke: var(--primary);
  fill: none;
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  stroke-width: 3;
  stroke: var(--primary);
  animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
  100% {
    stroke-dashoffset: 0;
  }
}

/* Responsive Styles */
@media (max-width: 768px) {
  .form-container {
    padding: 2rem 1.5rem;
  }
  
  .form-section {
    padding: 1.5rem 1rem;
  }
  
  .name-fields {
    flex-direction: column;
    gap: 0;
  }
  
  .buttons-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .button {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .form-header h1 {
    font-size: 2rem;
  }
  
  .form-section h2 {
    font-size: 1.25rem;
  }
}

/* Add these CSS styles to styles.css */

/* File list styling */
.file-list {
  margin-top: 10px;
  width: 100%;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin-bottom: 5px;
  background-color: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9rem;
}

.file-item .file-name {
  margin: 0;
  flex-grow: 1;
  color: var(--primary-dark);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 10px;
}

.file-delete {
  background: var(--error);
  color: white;
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.file-delete:hover {
  background-color: #DC2626;
  transform: scale(1.1);
}

.file-upload-container {
  position: relative;
}

.file-name {
  display: block;
  margin-top: 0.5rem;
  color: var(--primary-dark);
}
/* Style for file count indicator */
.file-count {
  display: inline-block;
  background-color: var(--primary);
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
}

/* Max file warning */
.max-files-warning {
  color: var(--error);
  font-size: 0.8rem;
  margin-top: 5px;
  font-weight: 500;
}

/* Final tooltip styles with all issues fixed */
.info-icon-container {
  position: relative;
  display: inline-block;
  margin-left: 8px;
  vertical-align: middle;
  z-index: 10; /* Ensure the container has proper z-index */
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: black;
  color: white;
  font-size: 24px;
  font-weight: bold;
  cursor: help;
  transition: background-color 0.2s, transform 0.2s;
  font-style: normal;
  position: relative;
  z-index: 11;
}

.info-icon::after {
  content: "ℹ"; /* Changed to information symbol */
}

.info-icon:hover, .info-icon:focus {
  background-color: var(--primary-dark);
  transform: scale(1.1);
}

/* Hover Tooltip styling */
.hover-tooltip {
  position: absolute;
  z-index: 100;
  width: 650px; /* Keep comprehensive width */
  background-color: white;
  border: 2px solid var(--primary);
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  top: -20px;
  left: 30px;
  opacity: 0;
  visibility: hidden; /* Initially hidden */
  transition: opacity 0.3s;
  pointer-events: none;
  max-height: 80vh; /* Prevent extremely tall tooltips */
  overflow-y: auto;
  /* Remove padding-top to fix white space issue */
  margin-top: 0;
}

/* Show tooltip when hovering over icon */
.info-icon-container:hover > .hover-tooltip {
  opacity: 1;
  visibility: visible;
  pointer-events: auto; /* Allow interaction with tooltip content */
}

/* Keep tooltip visible when hovering it directly */
.hover-tooltip:hover {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.hover-tooltip-header {
  background-color: var(--primary);
  color: white;
  margin: 0;
  padding: 15px 25px;
  border-radius: 6px 6px 0 0;
  font-size: 1.3rem;
  font-family: 'Playfair Display', serif;
  position: sticky; /* Keep header visible when scrolling */
  top: 0;
  z-index: 10; /* Ensure header stays above content when sticky */
}

.hover-tooltip-body {
  padding: 25px 30px;
  display: flex;
  flex-direction: row; /* Side-by-side layout by default */
}

.hover-tooltip .guidelines-text {
  flex: 1;
  margin-right: 25px;
}

.hover-tooltip .guidelines-text ul {
  padding-left: 25px;
  margin: 12px 0;
}

.hover-tooltip .guidelines-text li {
  margin-bottom: 8px;
}

.hover-tooltip .drawing-example {
  flex: 1;
  position: relative;
  text-align: center;
  margin-top: 10px;
}

.tooltip-example-image {
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 10px;
  height: auto; /* Ensure proper scaling */
  object-fit: contain; /* Prevent distortion */
  cursor: pointer;
}

.tooltip-example-image:hover {
  opacity: 0.9;
}

/* Position fullscreen icon over the image */
.tooltip-fullscreen-icon {
  position: absolute;
  bottom: 20px; /* Position above the caption */
  right: 10px;
  width: 30px;
  height: 30px;
  background-color: rgba(0,0,0,0.6);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  z-index: 50; /* Higher z-index to ensure visibility */
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.drawing-example:hover .tooltip-fullscreen-icon {
  opacity: 1;
}

.example-caption {
  font-size: 0.9rem;
  color: var(--text-light);
  display: block;
  margin-top: 8px;
}

/* Hide the popup completely, since we're using the hover tooltip instead */
.info-popup {
  display: none !important;
}

/* Fixed Fullscreen Overlay Styling */
.fullscreen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000; /* Very high z-index to appear above everything */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fullscreen-overlay.active {
  opacity: 1;
}

.fullscreen-image-container {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.fullscreen-image {
  max-width: 100%;
  max-height: 90vh;
  border: 2px solid rgba(255,255,255,0.2);
  box-shadow: 0 5px 25px rgba(0,0,0,0.5);
}

.close-fullscreen {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 36px;
  height: 36px;
  background-color: rgba(255,255,255,0.2);
  border: none;
  border-radius: 50%;
  font-size: 24px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s;
  z-index: 2001; /* Higher than the overlay */
}

.close-fullscreen:hover {
  background-color: rgba(255,255,255,0.4);
}

/* Bridge for smoother hover transition */
.hover-bridge {
  position: absolute;
  height: 20px;
  left: 0;
  right: 0;
  background: transparent;
  top: -20px;
  z-index: 15;
}

/* Responsive adjustments */
@media (max-width: 767px) {
  .hover-tooltip {
    left: auto;
    right: 0;
    top: 25px;
    width: 320px;
  }
  
  .hover-tooltip-body {
    flex-direction: column; /* Stack on small screens */
  }
  
  .hover-tooltip .guidelines-text {
    margin-right: 0;
    margin-bottom: 20px;
  }
}