/* Tracking System Styles for Sphynx Tequila Website */

/* Ensure tracking page content is positioned below the fixed header */
main {
  margin-top: 120px; /* Account for 90px header height + extra spacing */
}

.page-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--black, #000000);
  margin-bottom: 3rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  main {
    margin-top: 100px; /* Slightly less margin on mobile */
  }
  
  .page-title {
    font-size: 2rem;
    margin-bottom: 2rem;
  }
}

.tracking-container {
  max-width: 900px;
  margin: 0 auto 4rem;
  background-color: rgba(0, 0, 0, 0.02);
  border-radius: 20px;
  padding: 3rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

/* Form Styles */
.tracking-form-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 3rem;
  position: relative;
}

/* Cat Typing Animation Styles */
.cat-typing-display {
  min-height: 60px;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(198, 165, 124, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-radius: 15px;
  border: 1px solid rgba(198, 165, 124, 0.1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(198, 165, 124, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.cat-typing-display:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(198, 165, 124, 0.15);
}

.cat-typing-display::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(198, 165, 124, 0.1), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}

.typing-text {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: #333;
  line-height: 1.5;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 2;
}

.cursor {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.1rem;
  color: #C6A57C;
  animation: blink 1s infinite;
  font-weight: 600;
  margin-left: 2px;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Typing Animation States */
.cat-typing-display.thinking {
  background: linear-gradient(135deg, rgba(198, 165, 124, 0.08) 0%, rgba(255, 255, 255, 0.05) 100%);
  transform: scale(1.02);
  transition: all 0.3s ease;
}

.cat-typing-display.typing {
  box-shadow: 0 6px 20px rgba(198, 165, 124, 0.15);
  border-color: rgba(198, 165, 124, 0.2);
}

.cat-typing-display.complete {
  background: linear-gradient(135deg, rgba(198, 165, 124, 0.1) 0%, rgba(255, 255, 255, 0.08) 100%);
}

/* Click hint */
.cat-typing-display::after {
  content: '💭 Click me for more jokes!';
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  color: rgba(198, 165, 124, 0.6);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  font-family: 'Montserrat', sans-serif;
}

.cat-typing-display:hover::after {
  opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
  .cat-typing-display {
    padding: 1rem;
    margin-bottom: 1.5rem;
    min-height: 50px;
  }
  
  .typing-text {
    font-size: 1rem;
  }
  
  .cursor {
    font-size: 1rem;
  }
  
  .cat-typing-display::after {
    font-size: 0.7rem;
    bottom: -25px;
  }
}

@media (max-width: 480px) {
  .cat-typing-display {
    padding: 0.8rem;
    border-radius: 12px;
  }
  
  .typing-text {
    font-size: 0.9rem;
    line-height: 1.4;
  }
  
  .cursor {
    font-size: 0.9rem;
  }
}

.tracking-cat-icon {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  animation: float 6s ease-in-out infinite;
  transition: transform 0.3s ease;
}

.tracking-cat:hover .tracking-cat-icon {
  transform: scale(1.1) rotate(5deg);
}

.tracking-form {
  width: 100%;
  max-width: 600px;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.5rem;
}

.form-group label {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--black);
  font-size: 1.1rem;
}

.input-container {
  display: flex;
  position: relative;
}

.input-container input {
  flex: 1;
  padding: 1rem 1.5rem;
  border: 2px solid var(--gold);
  border-radius: 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  transition: var(--transition);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.input-container input:focus {
  outline: none;
  border-color: var(--navy-accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.input-container button {
  position: absolute;
  right: 5px;
  top: 5px;
  bottom: 5px;
  background-color: var(--gold);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0 1.5rem;
  font-family: 'CASTELAR', serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.input-container button:hover {
  background-color: var(--navy-accent);
}

.hint {
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Results Styles */
.tracking-results {
  display: none;
}

.tracking-loader {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(198, 165, 124, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

.tracking-error {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: #e74c3c;
  text-align: center;
}

.tracking-error i {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.tracking-warning {
  display: none;
  background-color: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.tracking-warning i {
  color: #856404;
  font-size: 1.5rem;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.tracking-warning .warning-content h4 {
  color: #856404;
  margin: 0 0 0.5rem 0;
  font-family: 'CASTELAR', serif;
  font-size: 1.2rem;
}

.tracking-warning .warning-content p {
  color: #856404;
  margin: 0.5rem 0;
  line-height: 1.5;
}

.tracking-warning .warning-content ul {
  color: #856404;
  margin: 0.5rem 0 0.5rem 1.5rem;
  line-height: 1.5;
}

.tracking-warning .warning-content li {
  margin-bottom: 0.25rem;
}

.tracking-success {
  display: none;
}

/* Package Info Styles */
.package-info {
  background-color: white;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.package-info h3 {
  font-family: 'CASTELAR', serif;
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  color: var(--navy-accent);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.info-item {
  display: flex;
  flex-direction: column;
}

.info-item .label {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.3rem;
}

.info-item .value {
  font-weight: 600;
  font-size: 1.1rem;
}

.status-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
  background-color: var(--gold);
}

/* Status-specific badge colors */
.status-badge.processing {
  background-color: #6c757d; /* Gray for processing */
  background: linear-gradient(135deg, #6c757d 0%, #545b62 100%);
  box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.status-badge.in-transit {
  background-color: #6f42c1; /* Purple for in-transit */
  background: linear-gradient(135deg, #6f42c1 0%, #5a359a 100%);
  box-shadow: 0 2px 8px rgba(111, 66, 193, 0.3);
}

.status-badge.out-for-delivery {
  background-color: #17a2b8; /* Teal blue for out-for-delivery */
  background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
  box-shadow: 0 2px 8px rgba(23, 162, 184, 0.3);
}

.status-badge.delivered {
  background-color: #28a745; /* Green for delivered */
  background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

/* Exception status colors */
.status-badge.on-hold {
  background-color: #ffc107; /* Yellow for on-hold */
  color: #212529; /* Dark text for better contrast */
}

.status-badge.delivery-exception {
  background-color: #dc3545; /* Red for delivery issues */
}

/* Other completion statuses */
.status-badge.delivered-damaged {
  background-color: #e67e22; /* Orange-red for damaged delivery */
}

.status-badge.delivered-partial {
  background-color: #f39c12; /* Orange for partial delivery */
}

.status-badge.returned {
  background-color: #8e44ad; /* Purple for returned */
}

.status-badge.stopped,
.status-badge.destroyed,
.status-badge.closed,
.status-badge.forwarded {
  background-color: #95a5a6; /* Gray for stopped/closed shipments */
}

/* Timeline Styles */
.tracking-timeline {
  background-color: white;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.tracking-timeline h3 {
  font-family: 'CASTELAR', serif;
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  color: var(--navy-accent);
}

.timeline-progress {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin: 2rem 0;
  --progress: 0%;
  --progress-height: 0%;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  flex: 1;
}

.step-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: white;
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  position: relative;
  transition: var(--transition);
}

.step-icon i {
  font-size: 1.2rem;
  color: var(--gold);
  transition: var(--transition);
}

.step-label {
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  max-width: 120px;
}

.step-date {
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.3rem;
}

.timeline-progress::before {
  content: '';
  position: absolute;
  top: 25px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #e0e0e0;
  z-index: 1;
}

.timeline-progress::after {
  content: '';
  position: absolute;
  top: 25px;
  left: 0;
  height: 2px;
  background-color: var(--gold);
  z-index: 1;
  width: var(--progress);
  transition: width 1.5s ease-in-out;
}

/* Exception status timeline styling */
.timeline-progress.exception-status::after {
  background-color: #ffc107; /* Yellow for exceptions */
}

.timeline-step.completed .step-icon {
  background-color: var(--gold);
  border-color: var(--gold);
}

.timeline-step.completed .step-icon i {
  color: white;
}

.timeline-step.active .step-icon {
  transform: scale(1.15);
  box-shadow: 0 0 0 4px rgba(198, 165, 124, 0.3);
  background: linear-gradient(135deg, var(--gold) 0%, #b8941f 100%);
  animation: pulse 2s infinite;
}

/* Add pulse animation for active step */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 4px rgba(198, 165, 124, 0.3);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(198, 165, 124, 0.2);
  }
  100% {
    box-shadow: 0 0 0 4px rgba(198, 165, 124, 0.3);
  }
}

/* Make active step label more prominent */
.timeline-step.active .step-label {
  font-weight: 700;
  color: var(--navy-accent);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Exception timeline steps */
.timeline-step.exception .step-icon {
  background-color: #ffc107;
  border-color: #ffc107;
}

.timeline-step.exception.active .step-icon {
  box-shadow: 0 0 0 4px rgba(255, 193, 7, 0.3);
}

.timeline-step.exception .step-icon i {
  color: #212529;
}

/* History Styles */
.tracking-history {
  background-color: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.tracking-history h3 {
  font-family: 'CASTELAR', serif;
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  color: var(--navy-accent);
}

.history-container {
  display: flex;
  flex-direction: column;
}

.history-item {
  display: flex;
  padding: 1rem 0;
  border-bottom: 1px solid #eee;
}

.history-item:last-child {
  border-bottom: none;
}

.history-date {
  flex: 0 0 150px;
}

.history-date .date {
  font-weight: 600;
  font-size: 0.9rem;
}

.history-date .time {
  font-size: 0.8rem;
  color: #666;
}

.history-content {
  flex: 1;
}

.history-content .location {
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.history-content .description {
  font-size: 0.9rem;
  color: #444;
}

/* Animations */
@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Fade In Animation for Steps */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.timeline-step {
  opacity: 0;
  animation: fadeIn 0.5s forwards;
}

.history-item {
  opacity: 0;
  animation: fadeIn 0.5s forwards;
}

/* Responsive Design */
@media (max-width: 768px) {
  .tracking-container {
    padding: 1.5rem;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
  }
  
  .timeline-progress {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .timeline-step {
    flex-direction: row;
    width: 100%;
    margin-bottom: 1.5rem;
    align-items: flex-start;
  }
  
  .step-icon {
    margin-right: 1rem;
    margin-bottom: 0;
  }
  
  .timeline-progress::before {
    height: 100%;
    width: 2px;
    top: 0;
    left: 25px;
    right: auto;
  }
  
  .timeline-progress::after {
    height: var(--progress-height);
    width: 2px;
    top: 0;
    left: 25px;
    right: auto;
    transition: height 1.5s ease-in-out;
  }
  
  .history-item {
    flex-direction: column;
  }
  .history-date {
    margin-bottom: 0.5rem;
  }
}

/* Cat Joke Animation Styles */
.cat-joke-container {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid var(--gold);
  border-radius: 20px;
  padding: 12px 16px;
  max-width: 280px;
  box-shadow: 0 8px 25px rgba(198, 165, 124, 0.3);
  opacity: 0;
  transform: translateX(-50%) translateY(-10px) scale(0.9);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10;
}

.cat-joke-container.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  animation: jokeAppear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes jokeAppear {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px) scale(0.8) rotate(-5deg);
  }
  60% {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px) scale(1.05) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1) rotate(0deg);
  }
}

.cat-joke-container::before {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--gold);
}

.cat-joke-container::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(255, 255, 255, 0.95);
}

.cat-joke-text {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--navy-accent);
  margin: 0;
  text-align: center;
  line-height: 1.4;
  letter-spacing: 0.3px;
}

/* Typing animation cursor */
.cat-joke-text::after {
  content: '|';
  color: var(--gold);
  animation: blink 1s infinite;
  font-weight: 600;
}

.cat-joke-text.typing-complete::after {
  display: none;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Pulsing animation for when joke is about to appear */
.tracking-cat.joke-ready {
  animation: catPulse 2s ease-in-out infinite;
}

@keyframes catPulse {
  0%, 100% { 
    transform: scale(1);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  }
  50% { 
    transform: scale(1.03);
    filter: drop-shadow(0 6px 12px rgba(198, 165, 124, 0.3));
  }
}
