/**
 * Application Tracker - Additional Styles
 * Extends base styles from master_timeline.html
 */

/* Chat Widget Container */
.chat-widget-container {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.chat-widget-container.open {
  display: block;
}

/* Progress Bar Vertical */
.progress-bar-vertical {
  width: 6px;
  height: 180px;
  background: #e5e7eb;
  border-radius: 3px;
  position: relative;
}

.progress-bar-fill {
  width: 100%;
  position: absolute;
  top: 0;
  background: #087f5b;
  border-radius: 4px;
  transition: height 0.3s;
}

/* Milestone Delayed */
.milestone-delayed {
  border-left: 4px solid #dc2626 !important;
}

/* Sidebar Navigation Items */
.sidebar-nav-item {
  cursor: pointer;
  transition: all 0.2s;
}

.sidebar-nav-item:hover {
  background-color: #f3f4f6;
  padding-left: 0.5rem;
}

.sidebar-nav-item.active {
  background-color: #e0f2fe;
  border-left: 3px solid #0284c7;
  padding-left: 0.5rem;
  font-weight: 600;
}

/* Service Tile Shadow */
.service-tile-shadow {
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.service-tile-shadow:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

/* Relocation Process Step Shadow */
.relocation-process-step-shadow {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease;
}

.relocation-process-step-shadow:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Milestone Card Base Styles */
.milestone-card {
  transition: all 0.3s ease;
}

.milestone-card:hover {
  transform: translateY(-2px);
}

/* Milestone Header */
.milestone-header {
  cursor: pointer;
  user-select: none;
}

.milestone-header:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

/* Milestone Content Expand/Collapse */
.milestone-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
  opacity: 0;
}

.milestone-content.expanded {
  max-height: 2000px;
  opacity: 1;
}

/* Chevron Icon Rotation */
.chevron-icon {
  transition: transform 0.3s ease;
}

.chevron-icon.rotated {
  transform: rotate(180deg);
}

/* Tips Box */
.tips-box {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  border: 1px solid #b2ddff;
}

/* Service Tile Placeholder */
.service-tile-placeholder {
  background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
  border: 2px solid #1e40af;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .progress-bar-fill {
    background: #000;
  }
}

/* Subscription Banner - Account for sidebar */
#subscription-banner {
  animation: slideDown 0.3s ease-out;
  position: sticky;
  top: 0;
  z-index: 30;
}

/* Main content area - account for sidebar */
@media (min-width: 1024px) {
  #subscription-banner {
    margin-left: 260px;
  }
  
  main {
    margin-left: 260px !important;
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Subscription Modal */
#subscription-modal {
  animation: fadeIn 0.2s ease-out;
}

#subscription-modal .bg-white {
  animation: slideUp 0.3s ease-out;
}

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

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

/* Premium Badge */
.premium-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.premium-lock {
  font-size: 0.75rem;
}

/* Delay Badge Enhancement */
.delay-badge {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Predictive Forecast */
#predictive-forecast-sidebar {
  background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
  border-left: 3px solid #9333ea;
}

/* Alerts */
.alert-item {
  transition: all 0.2s ease;
}

.alert-item:hover {
  transform: translateX(4px);
}

/* Progress Bar Enhancements - Additional transitions */
.progress-bar-fill {
  transition: height 0.5s ease-out;
}

/* Milestone Card Premium Features */
.milestone-card.premium-feature {
  border-left: 4px solid #9333ea;
}

.milestone-card.premium-feature::before {
  content: "⭐";
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 1rem;
  opacity: 0.7;
}

/* Subscription Status Badge */
#subscription-badge .bg-blue-100 {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

#subscription-badge .bg-purple-100 {
  background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
}

/* Settings Button */
#sidebar-settings:hover {
  background: #f3f4f6;
}

/* Alert Settings Modal */
#alerts-modal .bg-white {
  max-width: 600px;
}

/* Feature Gate Overlay */
.feature-gate-overlay {
  position: relative;
}

.feature-gate-overlay::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(2px);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.feature-gate-overlay::before {
  content: "🔒 Premium Feature";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 11;
  font-weight: 600;
  color: #9333ea;
}

/* Sidebar Positioning - Fixed on Left Side */
#progress-sidebar {
  position: fixed;
  left: 0.75rem;
  top: 1rem;
  width: 240px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  z-index: 40;
}

/* Main Content Offset for Sidebar */
@media (min-width: 1024px) {
  main {
    margin-left: 260px !important;
  }
}

/* Responsive Adjustments */
@media (max-width: 1023px) {
  #progress-sidebar {
    display: none !important;
  }
  
  main {
    margin-left: 0 !important;
  }
  
  #subscription-banner {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #e5e7eb;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Notification Toast */
.notification-toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Subscription Tier Badges */
.tier-badge-free {
  background: #f3f4f6;
  color: #6b7280;
}

.tier-badge-basic {
  background: #dbeafe;
  color: #1e40af;
}

.tier-badge-premium {
  background: #f3e8ff;
  color: #7e22ce;
}

/* Enhanced Milestone Cards - Additional hover effects */
.milestone-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.milestone-card.milestone-delayed {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Alert Icons */
.alert-icon {
  font-size: 1.5rem;
  margin-right: 0.5rem;
}

/* Forecast Display */
.forecast-display {
  background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
  border: 2px solid #9333ea;
  border-radius: 0.75rem;
  padding: 1rem;
  margin: 1rem 0;
}

.forecast-date {
  font-size: 1.5rem;
  font-weight: 700;
  color: #7e22ce;
}

.forecast-confidence {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.5rem;
}

/* Upgrade CTA */
.upgrade-cta {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.upgrade-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
}

/* Feature Comparison Table */
.feature-comparison {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.feature-comparison th,
.feature-comparison td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.feature-comparison th {
  background: #f9fafb;
  font-weight: 600;
  color: #374151;
}

.feature-comparison .check {
  color: #10b981;
  font-weight: bold;
}

.feature-comparison .cross {
  color: #ef4444;
  font-weight: bold;
}

/* Settings Panel */
.settings-panel {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin: 1rem 0;
}

.settings-section {
  margin-bottom: 1.5rem;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.75rem;
}

/* Alert List */
#alerts-list {
  max-height: 400px;
  overflow-y: auto;
}

.alert-item {
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  border: 1px solid #e5e7eb;
}

.alert-item.alert-high {
  background: #fee2e2;
  border-color: #fca5a5;
}

.alert-item.alert-medium {
  background: #fef3c7;
  border-color: #fcd34d;
}

.alert-item.alert-low {
  background: #dbeafe;
  border-color: #93c5fd;
}

/* Smooth Transitions */
* {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Timeline Chart Styles */
#timeline-chart-container {
  min-height: 400px;
}

.timeline-chart {
  width: 100%;
}

.timeline-track {
  position: relative;
  height: 24px;
  background: linear-gradient(90deg, #e5e7eb 0%, #d1d5db 100%);
  border-radius: 12px;
  overflow: visible;
}

.milestone-marker {
  position: absolute;
  z-index: 10;
}

.milestone-dot {
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.milestone-dot:hover {
  transform: scale(1.3);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  z-index: 20;
}

.milestone-label {
  display: none;
  z-index: 30;
  pointer-events: none;
}

.milestone-marker:hover .milestone-label {
  display: block;
}

.milestone-label .bg-white {
  white-space: nowrap;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Timeline animations */
@keyframes timelineProgress {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

.timeline-track .bg-green-500,
.timeline-track .bg-amber-500,
.timeline-track .bg-blue-300 {
  animation: timelineProgress 1s ease-out;
}

/* Today indicator */
.timeline-track + div[style*="left"] {
  z-index: 15;
}

/* Completion date indicator */
.timeline-track + div[style*="left: 100%"] {
  z-index: 15;
}

/* Responsive timeline chart */
@media (max-width: 768px) {
  .milestone-label {
    width: 200px !important;
  }
  
  .milestone-marker {
    transform: scale(0.8);
  }
  
  #timeline-chart-container {
    padding: 1rem !important;
  }
}

/* Print Styles */
@media print {
  #subscription-banner,
  #progress-sidebar,
  #subscription-modal,
  #alerts-modal,
  .upgrade-cta,
  #upgrade-btn {
    display: none !important;
  }
  
  main {
    margin-left: 0 !important;
  }
  
  #timeline-chart-container {
    page-break-inside: avoid;
  }
}

