/**
 * Bait Alamer House Progress Tracker
 * Premium Dark Theme with Responsive Design
 * No external dependencies - all local assets
 */

/* ===== CSS VARIABLES ===== */
:root {
  /* Colors - Bright matte theme */
  --bg: #3a4556; /* Brighter slate blue */
  --fg: #ffffff; /* Pure white */
  --muted: #94a3b8; /* Brighter blue-gray */
  --line: #475569; /* Lighter blue-gray */
  --accent: #f59e0b; /* Bright amber */
  --card: #475569; /* Brighter card background */
  --card-hover: #54667a; /* Lighter hover state */
  
  /* Effects - Matte style */
  --shadow: 0 4px 12px rgba(0, 0, 0, .15);
  --shadow-hover: 0 6px 16px rgba(0, 0, 0, .2);
  --glow: 0 0 8px rgba(245, 158, 11, 0.2);
  
  /* Border radius */
  --radius: 16px;
  --radius-img: 12px;
  --radius-small: 8px;
  
  /* Transitions */
  --ts: 220ms cubic-bezier(.2, .6, .2, 1);
  --ts-fast: 150ms ease-out;
  
  /* Typography */
  --font-system: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  
  /* Spacing scale */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  
  /* Type scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-system);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.7;
  color: var(--fg);
  background: linear-gradient(135deg, var(--bg) 0%, #475569 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}


/* Ensure header maintains consistent size */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(58, 69, 86, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(-10px);
  animation: headerFadeIn 1s ease-out 1.5s forwards;
  width: 100%;
  min-height: 70px;
  display: flex;
  align-items: center;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}

/* ===== FOCUS MANAGEMENT ===== */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-small);
}

/* ===== UTILITY CLASSES ===== */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-lg);
  }
}



/* ===== LOADING ANIMATION ===== */
@keyframes logoFadeIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.2) translateY(0) rotateY(0deg);
    filter: drop-shadow(0 0 0px rgba(192, 192, 192, 0));
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2) translateY(0) rotateY(0deg);
    filter: drop-shadow(0 0 30px rgba(192, 192, 192, 0.8));
  }
}

@keyframes logoGlow {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1.2) translateY(0) rotateY(0deg);
    filter: drop-shadow(0 0 30px rgba(192, 192, 192, 0.8));
  }
  50% {
    transform: translate(-50%, -50%) scale(1.25) translateY(0) rotateY(0deg);
    filter: drop-shadow(0 0 45px rgba(192, 192, 192, 1));
  }
}

@keyframes logoExit {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2) translateY(0) rotateY(0deg);
    filter: drop-shadow(0 0 30px rgba(192, 192, 192, 0.8));
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.1) translateY(0) rotateY(0deg);
    filter: drop-shadow(0 0 0px rgba(192, 192, 192, 0));
  }
}

.logo-loading {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 1000;
  animation: logoFadeIn 1s ease-out forwards;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
}

.logo-loading .logo {
  height: 200px;
  width: auto;
  background: white;
  padding: 20px;
  border-radius: var(--radius-small);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Hide content during logo animation */
body.loading main,
body.loading footer {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease-out;
}

body.loaded main,
body.loaded footer {
  opacity: 1;
  transform: translateY(0);
}

/* ===== HEADER ===== */

@keyframes headerFadeIn {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-xs) var(--space-sm);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  min-height: 70px;
}

@media (min-width: 768px) {
  .header-container {
    padding: var(--space-md) var(--space-lg);
  }
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo {
  height: 60px;
  width: auto;
  filter: drop-shadow(var(--glow));
  transition: filter var(--ts);
  background: white;
  padding: 6px;
  border-radius: var(--radius-small);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-left: -10px;
}

@media (min-width: 768px) {
  .logo {
    height: 100px;
    padding: 16px;
    margin-left: 0;
  }
}

.logo:hover {
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.3));
}

/* Navigation */
.nav-list {
  display: flex;
  list-style: none;
  gap: var(--space-sm);
  margin-left: auto;
}

@media (min-width: 768px) {
  .nav-list {
    gap: var(--space-lg);
    margin-left: auto;
  }
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color var(--ts);
  position: relative;
}

@media (min-width: 768px) {
  .nav-link {
    font-size: var(--text-base);
  }
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform var(--ts);
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--accent);
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  transform: scaleX(1);
}

/* ===== LOADING & ERROR STATES ===== */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  gap: var(--space-md);
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--line);
  border-top: 2px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.error {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--muted);
}

.error h2 {
  color: var(--fg);
  margin-bottom: var(--space-sm);
}

/* ===== HERO SECTION ===== */
.hero-section {
  padding: var(--space-2xl) 0;
  position: relative;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 2px;
  background: var(--accent);
  opacity: 0.8;
}

@media (min-width: 768px) {
  .hero-section {
    padding: 6rem 0;
  }
}

.hero-content {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.hero-title {
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
  background: linear-gradient(135deg, var(--fg) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: var(--text-4xl);
  }
}

.customer-name {
  font-size: var(--text-xl);
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-bottom: var(--space-xs);
  direction: rtl;
  text-align: center;
}

.customer-name .location-label {
  color: var(--muted);
  font-weight: 500;
  margin-left: var(--space-xs);
}

.customer-name .location-name {
  color: var(--accent);
  font-weight: 600;
}

@media (min-width: 768px) {
  .customer-name {
    font-size: var(--text-2xl);
  }
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--muted);
  font-weight: 300;
  letter-spacing: 0.02em;
}


/* ===== CARDS ===== */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-lg);
  box-shadow: var(--shadow);
  transition: all var(--ts);
  position: relative;
}

@media (min-width: 1024px) {
  .card {
    backdrop-filter: blur(6px);
  }
}

.card:hover {
  background: var(--card-hover);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
  border-color: var(--accent);
}

.card-title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--accent);
}

.card-date {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}

/* ===== IMAGE GRIDS ===== */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

/* Responsive breakpoints for image grid */
@media (max-width: 599px) {
  .image-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }
}

@media (min-width: 600px) and (max-width: 1023px) {
  .image-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .image-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.image-item {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-img);
  cursor: pointer;
  transition: transform var(--ts);
}

.image-item:hover {
  transform: scale(1.02);
}

.image-item img,
.image-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--ts);
}

.video-item {
  position: relative;
}

.video-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
  transition: transform var(--ts);
}

.video-item:hover .video-play-overlay {
  transform: translate(-50%, -50%) scale(1.1);
}

/* Image loading state with skeleton shimmer */
.image-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: shimmer 1.5s infinite;
  z-index: 1;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.image-item img[src] + .image-item::before {
  display: none;
}

/* ===== WORK LOG NOTES ===== */
.work-notes {
  margin-top: var(--space-md);
}

.work-notes ul {
  list-style: none;
  padding-left: 0;
}

.work-notes li {
  position: relative;
  padding-left: var(--space-lg);
  margin-bottom: var(--space-sm);
  color: var(--muted);
  line-height: 1.7;
}

.work-notes li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  transform: translateY(-50%);
}

/* ===== SECTIONS ===== */
.gallery-section,
.timeline-section {
  padding: var(--space-2xl) 0;
}

.section-title {
  font-size: var(--text-2xl);
  font-weight: 600;
  text-align: center;
  margin-bottom: var(--space-2xl);
  color: var(--fg);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: var(--accent);
}

@media (min-width: 768px) {
  .section-title {
    font-size: var(--text-3xl);
  }
}

/* ===== UPDATE ENTRIES ===== */
.update-entry {
  margin-bottom: var(--space-2xl);
}

.update-entry:last-child {
  margin-bottom: 0;
}

.update-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.update-date {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--accent);
}

.update-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--accent), transparent);
}

/* ===== TIMELINE ===== */
.timeline-content {
  max-width: 600px;
  margin: 0 auto;
}

.timeline-item {
  position: relative;
  padding-left: var(--space-xl);
  margin-bottom: var(--space-md);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: var(--space-sm);
  top: 0;
  bottom: -var(--space-md);
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--line));
}

.timeline-item:last-child::before {
  bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: 0;
  top: 0.5em;
  width: var(--space-md);
  height: var(--space-md);
  background: var(--accent);
  border-radius: 50%;
  transform: translateY(-50%);
  box-shadow: 0 0 0 4px var(--bg), var(--glow);
}

.timeline-date {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

.timeline-date a {
  color: inherit;
  text-decoration: none;
  transition: color var(--ts);
}

.timeline-date a:hover,
.timeline-date a:focus-visible {
  color: var(--fg);
}

.timeline-notes {
  color: var(--muted);
}

.timeline-notes ul {
  list-style: none;
  padding-left: 0;
}

.timeline-notes li {
  position: relative;
  padding-left: var(--space-md);
  margin-bottom: var(--space-xs);
  line-height: 1.6;
}

.timeline-notes li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

/* ===== SCHEDULE TIMELINE STYLES ===== */
.timeline-content {
  flex: 1;
  min-width: 0;
}

.timeline-work {
  margin: 0 0 var(--space-xs) 0;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--fg);
}

.progress-bar {
  position: relative;
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: var(--space-xs);
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
  border-radius: 3px;
}

.progress-text {
  position: absolute;
  right: 4px;
  top: -18px;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
}

/* Timeline dot status colors */
.timeline-dot.completed {
  background: #10b981;
  box-shadow: 0 0 0 4px var(--bg);
}

.timeline-dot.on-track {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}

.timeline-dot.in-progress {
  background: #3b82f6;
  box-shadow: 0 0 0 4px var(--bg);
}

.timeline-dot.started {
  background: #f59e0b;
  box-shadow: 0 0 0 4px var(--bg);
}

.timeline-dot.not-started {
  background: var(--muted);
  box-shadow: 0 0 0 4px var(--bg);
}

/* Mobile timeline adjustments */
@media (max-width: 767px) {
  .timeline-work {
    font-size: var(--text-sm);
  }
  
  .progress-text {
    font-size: 10px;
  }
}

/* ===== LIGHTBOX MODAL ===== */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--ts), visibility var(--ts);
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.lightbox-container {
  position: relative;
  width: 90vw;
  height: 90vh;
  max-width: 1000px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-hover);
  display: flex;
  flex-direction: column;
  transform: scale(0.9);
  transition: transform var(--ts);
}

.lightbox.active .lightbox-container {
  transform: scale(1);
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--line);
}

.lightbox-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--fg);
}

.lightbox-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: var(--text-2xl);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-small);
  transition: all var(--ts);
  line-height: 1;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  color: var(--fg);
  background: var(--line);
}

.lightbox-content {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lightbox-image-container {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image,
.lightbox-video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-small);
}

.lightbox-video {
  background: #000;
}

.image-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 1;
  transition: opacity var(--ts);
}

.lightbox-image[src] ~ .image-loading {
  opacity: 0;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: var(--fg);
  font-size: var(--text-3xl);
  padding: var(--space-md);
  cursor: pointer;
  border-radius: var(--radius-small);
  transition: all var(--ts);
  z-index: 10;
}

.lightbox-nav:hover,
.lightbox-nav:focus-visible {
  background: rgba(0, 0, 0, 0.8);
  color: var(--accent);
}

.lightbox-prev {
  left: var(--space-md);
}

.lightbox-next {
  right: var(--space-md);
}

.lightbox-info {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--line);
  text-align: center;
}

.lightbox-counter {
  font-size: var(--text-sm);
  color: var(--muted);
  font-weight: 500;
}

/* Mobile lightbox adjustments */
@media (max-width: 767px) {
  .lightbox-container {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
  
  .lightbox-nav {
    padding: var(--space-sm);
    font-size: var(--text-xl);
  }
  
  .lightbox-prev {
    left: var(--space-sm);
  }
  
  .lightbox-next {
    right: var(--space-sm);
  }
}

/* ===== FOOTER ===== */
.footer {
  margin-top: var(--space-2xl);
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--line);
  background: var(--card);
}

.footer-content {
  text-align: center;
}

.footer-company {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: var(--space-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.footer-contact {
  font-size: var(--text-sm);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.footer-separator {
  color: var(--line);
}

@media (max-width: 599px) {
  .footer-contact {
    flex-direction: column;
    gap: var(--space-xs);
  }
  
  .footer-separator {
    display: none;
  }
}

/* ===== SCHEDULE SECTION ===== */
.schedule-section {
  padding: var(--space-2xl) 0;
  background: var(--bg);
}

.schedule-section .section-title {
  text-align: center;
  margin-bottom: var(--space-md);
  font-family: var(--font-system);
  font-weight: 600;
  color: var(--accent);
}

/* Project Dates */
.project-dates {
  text-align: center;
  margin-bottom: var(--space-xl);
  padding: var(--space-md) 0;
}

.project-dates-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-base);
  color: var(--muted);
}

.date-label {
  font-weight: 500;
  color: var(--fg);
}

.date-value {
  color: var(--accent);
  font-weight: 600;
}

.date-separator {
  color: var(--line);
  margin: 0 var(--space-xs);
}

@media (max-width: 767px) {
  .project-dates-info {
    flex-direction: column;
    gap: var(--space-xs);
  }
  
  .date-separator {
    display: none;
  }
}

/* Schedule Controls */
.schedule-controls {
  margin-bottom: var(--space-xl);
}

.schedule-toolbar {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  align-items: center;
}

@media (min-width: 768px) {
  .schedule-toolbar {
    flex-direction: row;
    justify-content: space-between;
  }
}

.sort-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  justify-content: center;
}

@media (min-width: 768px) {
  .sort-controls {
    justify-content: flex-start;
  }
}

.sort-btn {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-small);
  font-size: var(--text-sm);
  font-family: var(--font-system);
  cursor: pointer;
  transition: all var(--ts);
  white-space: nowrap;
}

.sort-btn:hover,
.sort-btn:focus-visible {
  background: var(--card-hover);
  color: var(--accent);
  border-color: var(--accent);
}

.sort-btn.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.search-controls {
  display: flex;
  justify-content: center;
  width: 100%;
}

@media (min-width: 768px) {
  .search-controls {
    width: auto;
    justify-content: flex-end;
  }
}

.search-input {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--fg);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-small);
  font-size: var(--text-sm);
  font-family: var(--font-system);
  width: 200px;
  max-width: 100%;
  transition: all var(--ts);
  text-align: right;
  direction: rtl;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(197, 165, 114, 0.2);
}

.search-input::placeholder {
  color: var(--muted);
  font-style: italic;
}

/* Schedule Table */
.schedule-table-container {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  overflow-x: auto;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-system);
  direction: rtl;
  text-align: right;
}

.schedule-table thead {
  background: var(--card-hover);
  position: sticky;
  top: 0;
  z-index: 10;
}

.schedule-table th {
  padding: var(--space-md);
  font-weight: 600;
  color: var(--accent);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}

.schedule-table tbody tr {
  transition: background-color var(--ts);
  border-bottom: 1px solid var(--line);
}

.schedule-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.schedule-table tbody tr:hover {
  background: var(--card-hover);
}

.schedule-table td {
  padding: var(--space-md);
  color: var(--fg);
  font-size: var(--text-sm);
  line-height: 1.5;
  vertical-align: top;
}

.schedule-table .work-cell {
  font-weight: 500;
  color: var(--accent);
  min-width: 150px;
}

.schedule-table .duration-cell {
  color: var(--muted);
  min-width: 100px;
}

.schedule-table .date-cell {
  font-family: var(--font-mono);
  color: var(--fg);
  min-width: 90px;
}

.schedule-table .area-cell {
  color: var(--muted);
  min-width: 120px;
}

.schedule-table .notes-cell {
  color: var(--muted);
  font-style: italic;
  min-width: 150px;
}

.schedule-table .empty-cell {
  color: var(--muted);
  text-align: center;
}

.schedule-table .empty-cell::before {
  content: '—';
  font-size: var(--text-lg);
}

/* Mobile Schedule Table */
@media (max-width: 767px) {
  .schedule-table-container {
    border: none;
    box-shadow: none;
    background: transparent;
    overflow: visible;
  }
  
  .schedule-table,
  .schedule-table thead,
  .schedule-table tbody,
  .schedule-table th,
  .schedule-table td,
  .schedule-table tr {
    display: block;
  }
  
  .schedule-table thead {
    position: static;
    display: none;
  }
  
  .schedule-table tbody tr {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: var(--space-md);
    padding: var(--space-md);
    box-shadow: var(--shadow);
  }
  
  .schedule-table tbody tr:nth-child(even) {
    background: var(--card);
  }
  
  .schedule-table td {
    border: none;
    padding: var(--space-xs) 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    text-align: right;
  }
  
  .schedule-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--accent);
    margin-left: var(--space-sm);
    flex-shrink: 0;
    min-width: 80px;
  }
  
  .schedule-table td .cell-content {
    flex: 1;
    text-align: right;
  }
}

/* Schedule Footer */
.schedule-footer {
  margin-top: var(--space-lg);
  text-align: center;
}

.schedule-note {
  font-size: var(--text-xs);
  color: var(--muted);
  font-style: italic;
  background: var(--card);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-small);
  border: 1px solid var(--line);
  display: inline-block;
}

/* Schedule Loading State */
.schedule-loading {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--muted);
}

.schedule-error {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: var(--space-lg) 0;
}

/* Schedule Table Scrollbar Styling */
.schedule-table-container::-webkit-scrollbar {
  height: 6px;
}

.schedule-table-container::-webkit-scrollbar-track {
  background: var(--line);
  border-radius: 3px;
}

.schedule-table-container::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

.schedule-table-container::-webkit-scrollbar-thumb:hover {
  background: rgba(197, 165, 114, 0.8);
}

/* RTL Specific Adjustments */
[dir="rtl"] .schedule-table {
  text-align: right;
}

[dir="rtl"] .schedule-toolbar {
  direction: rtl;
}

[dir="rtl"] .sort-controls {
  direction: rtl;
}

[dir="rtl"] .search-input {
  text-align: right;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .schedule-table th {
    background: var(--bg);
    color: var(--fg);
  }
  
  .schedule-table tbody tr:hover {
    background: var(--line);
  }
}

/* Print Styles for Schedule */
@media print {
  .schedule-controls,
  .schedule-footer {
    display: none;
  }
  
  .schedule-table-container {
    box-shadow: none;
    border: 1px solid #000;
  }
  
  .schedule-table th,
  .schedule-table td {
    border: 1px solid #000;
    color: #000;
    background: white;
  }
  
  .schedule-table thead {
    background: #f0f0f0;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .header,
  .lightbox,
  .footer {
    display: none;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .card {
    border: 1px solid #ccc;
    box-shadow: none;
  }
}
/* ===== STATUS PILLS & SMART LOGIC ===== */
.status-pill {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  min-width: 85px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-completed {
  background: #10b981;
  color: white;
}

.status-on-time {
  background: #10b981;
  color: white;
}

.status-warning {
  background: #f59e0b;
  color: white;
}

.status-critical {
  background: #ef4444;
  color: white;
  animation: pulse 2s infinite;
}

.status-delayed {
  background: #ef4444;
  color: white;
}

.status-not-started {
  background: #6b7280;
  color: white;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Status Legend */
.status-legend {
  margin-top: var(--space-xl);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-lg);
  box-shadow: var(--shadow);
}

.legend-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: var(--space-md);
  text-align: center;
}

.legend-items {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

@media (min-width: 768px) {
  .legend-items {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border-radius: var(--radius-small);
  transition: all var(--ts);
  border: 1px solid transparent;
}

.legend-item:hover {
  background: rgba(197, 165, 114, 0.1);
  border-color: var(--accent);
}

.legend-text {
  font-size: var(--text-sm);
  color: var(--muted);
  flex: 1;
}

.schedule-table .status-cell {
  text-align: center;
  min-width: 110px;
}

/* Mobile status legend */
@media (max-width: 767px) {
  .legend-items {
    grid-template-columns: 1fr;
  }
  
  .legend-item {
    flex-direction: column;
    text-align: center;
    gap: var(--space-xs);
  }
  
  .status-pill {
    min-width: 120px;
  }
}

/* Enhanced mobile responsiveness */
@media (max-width: 480px) {
  .hero-title {
    font-size: var(--text-2xl);
    letter-spacing: -0.01em;
  }
  
  .hero-subtitle {
    font-size: var(--text-base);
  }
  
  .card {
    padding: var(--space-md);
  }
  
  .nav-link {
    font-size: var(--text-xs);
    letter-spacing: 0.03em;
  }
}

