/* Authentication System Styles - Scoped to avoid conflicts */

/* User Dropdown Menu */
.user-dropdown {
  background: white;
  border-radius: 15px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.1);
  min-width: 280px;
  overflow: hidden;
  animation: dropdownSlide 0.3s ease-out;
}

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

.user-info {
  padding: 1.5rem;
  background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
  color: white;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar i {
  font-size: 2.5rem;
  opacity: 0.9;
}

.user-name {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.user-email {
  font-size: 0.9rem;
  opacity: 0.8;
}

.menu-divider {
  height: 1px;
  background: #e1e5e9;
  margin: 0.5rem 0;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  color: var(--dark);
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 500;
}

.menu-item:hover {
  background: #f8f9fa;
  color: var(--primary);
  padding-left: 2rem;
}

.menu-item.logout {
  color: #dc3545;
}

.menu-item.logout:hover {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

/* Modal Styles */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.3s ease-out;
}

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

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  background: white;
  border-radius: 20px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  position: relative;
  animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
  padding: 2rem 2rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e1e5e9;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gray);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: #f8f9fa;
  color: var(--dark);
}

.modal-body {
  padding: 2rem;
  max-height: 60vh;
  overflow-y: auto;
}

/* Form Styles - Scoped to modal only */
.auth-modal .form-group {
  margin-bottom: 1.5rem;
}

.auth-modal label {
  display: block;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.auth-modal input,
.auth-modal textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid #e1e5e9;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #f8f9fa;
  box-sizing: border-box;
}

.auth-modal input:focus,
.auth-modal textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.auth-modal textarea {
  resize: vertical;
  min-height: 80px;
}

.auth-modal .checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500 !important;
  cursor: pointer;
}

.auth-modal .checkbox-label input[type="checkbox"] {
  width: auto !important;
  margin: 0;
  accent-color: var(--primary);
}

.auth-modal .btn-primary {
  background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.auth-modal .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(255, 107, 107, 0.4);
}

/* Orders List */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.order-item {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid #e1e5e9;
  transition: all 0.3s ease;
}

.order-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.order-id {
  font-weight: 600;
  color: var(--dark);
  font-size: 1.1rem;
}

.order-status {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-pending {
  background: #fff3cd;
  color: #856404;
}

.status-processing {
  background: #d1ecf1;
  color: #0c5460;
}

.status-completed {
  background: #d4edda;
  color: #155724;
}

.status-cancelled {
  background: #f8d7da;
  color: #721c24;
}

.order-date {
  color: var(--gray);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.order-total {
  font-weight: 600;
  color: var(--primary);
  font-size: 1.1rem;
}

/* Notifications */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border-left: 4px solid;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 10001;
  transform: translateX(400px);
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 350px;
  font-weight: 500;
}

.notification.show {
  transform: translateX(0);
  opacity: 1;
}

.notification-success {
  border-left-color: #28a745;
  color: #155724;
}

.notification-error {
  border-left-color: #dc3545;
  color: #721c24;
}

.notification-info {
  border-left-color: #17a2b8;
  color: #0c5460;
}

.notification i {
  font-size: 1.2rem;
}

/* Welcome Message */
.welcome-message {
  animation: welcomeSlide 0.5s ease-out;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .user-dropdown {
    right: 10px !important;
    left: 10px !important;
    width: auto;
    min-width: auto;
  }

  .modal-content {
    margin: 1rem;
    width: calc(100% - 2rem);
  }

  .modal-header,
  .modal-body {
    padding: 1.5rem;
  }

  .notification {
    right: 10px;
    left: 10px;
    max-width: none;
    transform: translateY(-100px);
  }

  .notification.show {
    transform: translateY(0);
  }
}

/* Integration with existing nav styles - Non-intrusive */
.nav-link[onclick] {
  cursor: pointer;
}

/* Only apply icon spacing to user menu, not all nav links */
.nav-link[onclick] i {
  margin-right: 0.5rem;
}

/* Tracking System Styles */
.tracking-container {
  max-width: 600px;
}

.tracking-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 12px;
}

.service-info h4 {
  margin: 0 0 0.5rem 0;
  color: var(--primary);
}

.service-info p {
  margin: 0.25rem 0;
  color: var(--gray);
  font-size: 0.9rem;
}

.eta-info {
  text-align: right;
}

.eta-time, .distance {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.eta-time {
  color: #28a745;
}

.distance {
  color: #17a2b8;
}

/* Map Container */
.map-container {
  margin: 1.5rem 0;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.map-placeholder {
  height: 350px;
  background: 
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(45deg, #2d5016 0%, #3d6b1a 25%, #4a7c23 50%, #2d5016 75%, #1a3d0f 100%);
  background-size: 50px 50px, 30px 30px, 100% 100%;
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Map Controls */
.map-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  justify-content: center;
}

.map-control-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  font-weight: 500;
}

.map-control-btn:hover {
  background: white;
  border-color: var(--primary);
  transform: translateY(-2px);
}

.map-control-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Satellite View Features */
.satellite-features {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.building {
  position: absolute;
  background: rgba(139, 69, 19, 0.8);
  border: 1px solid rgba(160, 82, 45, 0.9);
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.road {
  position: absolute;
  background: rgba(105, 105, 105, 0.7);
  border: 1px solid rgba(128, 128, 128, 0.8);
}

.road.horizontal {
  height: 8px;
}

.road.vertical {
  width: 8px;
}

.park {
  position: absolute;
  background: rgba(34, 139, 34, 0.6);
  border-radius: 50%;
  border: 2px solid rgba(46, 125, 50, 0.8);
}

.technician-marker, .user-marker {
  position: absolute;
  background: white;
  border-radius: 50%;
  padding: 0.75rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.technician-marker {
  top: 20%;
  left: 70%;
  background: #FF6B6B;
  color: white;
  font-size: 1.2rem;
  animation: moveToUser 10s infinite linear;
}

.marker-label {
  position: absolute;
  top: -45px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  pointer-events: none;
}

.marker-arrow {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid rgba(0, 0, 0, 0.8);
}

.user-marker {
  bottom: 20%;
  left: 10%;
  color: #28a745;
  font-size: 1.2rem;
  flex-direction: column;
  padding: 0.5rem;
}

.location-accuracy {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border: 2px solid rgba(33, 150, 243, 0.3);
  border-radius: 50%;
  background: rgba(33, 150, 243, 0.1);
  animation: accuracyPulse 2s infinite;
}

@keyframes accuracyPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.3; }
}

.user-marker span {
  font-size: 0.7rem;
  margin-top: 0.25rem;
  font-weight: 600;
}

.marker-pulse {
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

.route-line {
  position: absolute;
  top: 50px;
  left: 50px;
  width: calc(100% - 100px);
  height: 2px;
  background: linear-gradient(90deg, var(--primary), #28a745);
  transform: rotate(-15deg);
  transform-origin: left center;
}

.route-path {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

.animated-route {
  stroke-dasharray: 10, 5;
  animation: routeFlow 3s infinite linear;
}

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

.map-overlay {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.75rem;
  border-radius: 8px;
  z-index: 15;
}

.map-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.coordinates {
  font-size: 0.75rem;
  opacity: 0.8;
  font-family: monospace;
}

.zoom-controls {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 15;
}

.zoom-btn {
  width: 35px;
  height: 35px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ddd;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.zoom-btn:hover {
  background: white;
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.05);
}

@keyframes moveToUser {
  0% { top: 20%; left: 70%; }
  25% { top: 35%; left: 55%; }
  50% { top: 50%; left: 40%; }
  75% { top: 65%; left: 25%; }
  100% { top: 20%; left: 70%; }
}

/* Tracking Updates */
.tracking-updates {
  margin: 1.5rem 0;
}

.update-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 0.75rem;
  background: #f8f9fa;
  opacity: 0.6;
  transition: all 0.3s ease;
}

.update-item.active {
  background: #e8f5e8;
  opacity: 1;
  border-left: 4px solid #28a745;
}

.update-item i {
  font-size: 1.2rem;
  color: var(--gray);
  margin-top: 0.25rem;
}

.update-item.active i {
  color: #28a745;
}

.update-content {
  flex: 1;
}

.update-title {
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.25rem;
}

.update-time {
  font-size: 0.85rem;
  color: var(--gray);
}

/* Contact Actions */
.contact-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.contact-btn {
  flex: 1;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.contact-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.contact-btn.secondary {
  background: #6c757d;
  box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.contact-btn.secondary:hover {
  box-shadow: 0 8px 25px rgba(108, 117, 125, 0.4);
}

/* Order Tracking Styles */
.order-details {
  margin-top: 1rem;
}

.order-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.order-items {
  margin: 1rem 0;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.order-items h5 {
  margin: 0 0 0.75rem 0;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.item-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e1e5e9;
}

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

.item-name {
  flex: 1;
  font-weight: 500;
}

.item-qty {
  color: var(--gray);
  font-size: 0.9rem;
}

.item-price {
  font-weight: 600;
  color: var(--primary);
}

.tracking-info {
  margin-top: 1.5rem;
}

.tracking-status {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.tracking-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.4;
  transition: all 0.3s ease;
}

.tracking-step.active {
  opacity: 1;
  color: var(--primary);
}

.tracking-step i {
  font-size: 1.5rem;
}

.tracking-step span {
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
}

.delivery-estimate {
  background: #e8f5e8;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: #28a745;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Service Tracking */
.services-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #e1e5e9;
}

.services-section h4 {
  margin-bottom: 1.5rem;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.service-item {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid #e1e5e9;
}

.service-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.service-id {
  font-weight: 600;
  color: var(--dark);
}

.service-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.service-info, .appointment-info {
  display: flex;
  gap: 2rem;
}

.service-type, .service-date, .appointment-date, .technician-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.track-btn {
  background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

.track-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(23, 162, 184, 0.4);
}

/* Booking Confirmation Styles */
.booking-confirmation {
  text-align: center;
  padding: 1rem;
}

.confirmation-icon {
  font-size: 4rem;
  color: #28a745;
  margin-bottom: 1rem;
}

.booking-confirmation h3 {
  color: var(--dark);
  margin-bottom: 1.5rem;
}

.booking-details {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  text-align: left;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e1e5e9;
}

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

.detail-item strong {
  color: var(--dark);
}

.booking-actions {
  margin-top: 1.5rem;
}

@media (max-width: 768px) {
  .tracking-header {
    flex-direction: column;
    gap: 1rem;
  }
  
  .eta-info {
    text-align: left;
  }
  
  .contact-actions {
    flex-direction: column;
  }
  
  .order-info {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .tracking-status {
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .service-info, .appointment-info {
    flex-direction: column;
    gap: 0.5rem;
  }
}
