/* ===== MEDIA GALLERY STYLES ===== */
.page-hero {
  position: relative;
  background: var(--gradient-hero);
  color: white;
  text-align: center;
  padding: 6rem var(--spacing-lg) 4rem;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1" fill="rgba(255,255,255,0.03)"/><circle cx="60" cy="40" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="40" cy="70" r="1" fill="rgba(255,255,255,0.04)"/><circle cx="80" cy="80" r="1" fill="rgba(255,255,255,0.03)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  pointer-events: none;
}

.page-hero .hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.page-hero h1 {
  font-size: 3.5rem;
  margin-bottom: var(--spacing-lg);
  font-weight: 800;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.page-hero p {
  font-size: 1.3rem;
  opacity: 0.95;
  max-width: 600px;
  margin: 0 auto;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  line-height: 1.6;
}

/* Gallery Categories */
.gallery-categories {
  padding: var(--spacing-2xl) var(--spacing-lg);
  text-align: center;
}

.category-filters {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  margin-top: var(--spacing-xl);
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--color-bg-alt);
  border: 2px solid var(--color-border);
  color: var(--color-text);
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-lg);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

/* Project Gallery */
.project-gallery {
  padding: 0 var(--spacing-lg) var(--spacing-2xl);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--spacing-xl);
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: white;
  box-shadow: var(--shadow);
  transition: all var(--transition-normal);
  cursor: pointer;
  color: #1f2937; /* Dark text for light background */
}

.gallery-item:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.gallery-image {
  position: relative;
  height: 300px;
  overflow: hidden;
}

.gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.gallery-item:hover .gallery-image img {
  transform: scale(1.05);
}

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: white;
  padding: var(--spacing-xl);
  transform: translateY(20px);
  opacity: 0;
  transition: all var(--transition-normal);
}

.gallery-item:hover .gallery-overlay {
  transform: translateY(0);
  opacity: 1;
}

.gallery-overlay h3 {
  font-size: 1.5rem;
  margin-bottom: var(--spacing-sm);
  font-weight: 700;
}

.gallery-overlay p {
  font-size: 0.95rem;
  margin-bottom: var(--spacing-md);
  opacity: 0.9;
}

.gallery-tags {
  display: flex;
  gap: var(--spacing-xs);
  flex-wrap: wrap;
}

.gallery-tags .tag {
  background: rgba(255,255,255,0.2);
  color: white;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 500;
  backdrop-filter: blur(10px);
}

.gallery-hint {
  margin-top: var(--spacing-sm);
  font-size: 0.85rem;
  color: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gallery-hint:after {
  content: "→";
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-hint:after {
  transform: translateX(3px);
}

/* Case Studies */
.case-studies {
  background: var(--color-bg-alt);
  padding: var(--spacing-3xl) var(--spacing-lg);
}

.case-study-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: var(--spacing-xl);
  margin-top: var(--spacing-xl);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.case-study-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all var(--transition-normal);
  border: 1px solid rgba(203, 213, 225, 0.3);
  position: relative;
}

.case-study-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.case-study-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border-color: rgba(102, 126, 234, 0.3);
}

.case-study-image {
  height: 200px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.case-study-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
  pointer-events: none;
}

.case-study-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.case-study-card:hover .case-study-image img {
  transform: scale(1.05);
}

.case-study-content {
  padding: var(--spacing-xl);
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
}

.case-study-content h3 {
  font-size: 1.5rem;
  margin-bottom: var(--spacing-md);
  color: var(--color-text);
  font-weight: 700;
  background: linear-gradient(135deg, #1e40af 0%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.case-study-content p {
  color: var(--color-text-light);
  margin-bottom: var(--spacing-lg);
  line-height: 1.6;
  font-size: 0.95rem;
}

.case-study-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-lg) 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.case-study-stats .stat {
  text-align: center;
}

.case-study-stats .stat strong {
  display: block;
  font-size: 1.5rem;
  color: var(--color-primary);
  font-weight: 700;
}

.case-study-stats .stat span {
  font-size: 0.9rem;
  color: var(--color-text-light);
}

.case-study-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition-normal);
}

.case-study-link:hover {
  color: var(--color-primary-dark);
  transform: translateX(4px);
}

.case-study-reference {
  margin-bottom: var(--spacing-md);
}

.case-study-reference small {
  color: var(--color-text-muted);
  font-style: italic;
}

/* Technology Showcase */
.tech-showcase {
  padding: var(--spacing-3xl) var(--spacing-lg);
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-xl);
  margin-top: var(--spacing-xl);
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.tech-item {
  text-align: center;
  padding: var(--spacing-xl);
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  transition: all var(--transition-normal);
}

.tech-item:hover {
  background: white;
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.tech-icon {
  font-size: 3rem;
  margin-bottom: var(--spacing-lg);
  display: block;
}

.tech-item h3 {
  font-size: 1.25rem;
  margin-bottom: var(--spacing-md);
  color: var(--color-text);
}

.tech-item p {
  color: var(--color-text-light);
  font-size: 0.9rem;
}

/* Gallery CTA */
.gallery-cta {
  background: var(--gradient-primary);
  color: white;
  text-align: center;
  padding: var(--spacing-3xl) var(--spacing-lg);
}

.gallery-cta h2 {
  font-size: 2.5rem;
  margin-bottom: var(--spacing-md);
  font-weight: 700;
}

.gallery-cta p {
  font-size: 1.2rem;
  margin-bottom: var(--spacing-xl);
  opacity: 0.9;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta-buttons {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .page-hero {
    padding: 4rem var(--spacing-md) 3rem;
    min-height: 300px;
  }
  
  .page-hero h1 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
  }
  
  .page-hero p {
    font-size: 1.1rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  .case-study-grid {
    grid-template-columns: 1fr;
  }

  .case-study-stats {
    flex-direction: column;
    gap: var(--spacing-md);
    text-align: center;
  }

  .tech-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
  }

  .gallery-cta h2 {
    font-size: 2rem;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .category-filters {
    flex-direction: column;
    align-items: center;
  }

  .filter-btn {
    width: 200px;
  }

  .tech-grid {
    grid-template-columns: 1fr;
  }
}

/* Gallery filtering animation */
.gallery-item.hidden {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
  transition: all 0.3s ease;
}

.gallery-item.visible {
  opacity: 1;
  transform: scale(1);
  transition: all 0.3s ease;
}

/* Case Study Modal Styles */
.case-study-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.case-study-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 255, 255, 0.3);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal-body {
    overflow-y: auto;
    padding: 2rem;
    flex: 1;
}

.case-study-modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    position: relative;
    padding: 0;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 1;
}

.modal-header-content {
    position: relative;
    z-index: 2;
    padding: 2rem 2rem 1rem;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 60%, rgba(255,255,255,1) 100%);
    margin-top: 60px;
}

.modal-header h2 {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
    text-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.modal-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin: 0;
    font-weight: 400;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--primary-color)/0.1;
    color: var(--primary-color);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
}

.case-study-section {
    margin-bottom: 2rem;
}

.case-study-section h3 {
    color: var(--secondary-color);
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.case-study-section h3:before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.case-study-section p {
    color: #333333;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.result-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    transition: all 0.3s ease;
}

.result-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.2);
}

.result-metric {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1rem;
}

.tech-tag {
    background: linear-gradient(135deg, var(--primary-color)/0.2, var(--secondary-color)/0.2);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--primary-color)/0.3;
    transition: all 0.3s ease;
}

.tech-tag:hover {
    background: var(--primary-color);
    color: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.3);
}

.case-study-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 15px;
}

.detail-item {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.detail-item strong {
    color: var(--secondary-color);
    font-weight: 600;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #00bcd4, #2196f3);
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    border: none;
    box-shadow: 0 4px 15px rgba(0, 188, 212, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #00acc1, #1976d2);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 188, 212, 0.4);
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-weight: 500;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
}

/* Mobile Responsiveness for Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
        margin: 0;
    }

    .modal-header {
        padding: 1.5rem 1.5rem 1rem;
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }

    .modal-subtitle {
        font-size: 1rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .results-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }

    .result-item {
        padding: 1rem;
    }

    .result-metric {
        font-size: 2rem;
    }

    .case-study-details {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .modal-actions {
        flex-direction: column;
        gap: 0.8rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
        padding: 1rem;
    }
}

/* ===== WORK SNAPSHOTS GALLERY ===== */
.work-snapshots {
    padding: 4rem var(--spacing-lg);
    background: var(--color-background-alt);
}

.work-snapshots .section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.work-snapshots .section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.work-snapshots .section-header p {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.snapshot-viewer {
    max-width: 1200px;
    margin: 0 auto;
}

.viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.viewer-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.viewer-controls .filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--color-border);
    background: white;
    color: var(--color-text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.viewer-controls .filter-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.viewer-controls .filter-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.viewer-info {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.snapshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    /* Enable scrolling if content overflows */
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 1rem;
}

/* Horizontal scrolling variant for special projects */
.snapshot-grid.horizontal-scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) #f0f0f0;
}

.snapshot-grid.horizontal-scroll::-webkit-scrollbar {
    height: 8px;
}

.snapshot-grid.horizontal-scroll::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.snapshot-grid.horizontal-scroll::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 10px;
}

.snapshot-grid.horizontal-scroll .snapshot-item {
    flex: 0 0 280px;
    min-width: 280px;
}

.snapshot-item {
    position: relative;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.snapshot-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.snapshot-item:hover .snapshot-delete {
    opacity: 1;
    transform: translateY(0);
}

.snapshot-delete {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(220, 38, 38, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: bold;
    z-index: 10;
}

.snapshot-delete:hover {
    background: rgba(185, 28, 28, 1);
    transform: translateY(0) scale(1.1);
}

.snapshot-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.snapshot-info {
    padding: 1rem;
}

.snapshot-info h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.snapshot-info p {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.snapshot-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
}

.snapshot-category {
    background: var(--color-background);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.snapshot-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    border: 2px dashed var(--color-border);
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.snapshot-placeholder h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.snapshot-placeholder p {
    color: var(--color-text-secondary);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Modal Styles - Enhanced with Modern Features */
.snapshot-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease-out;
}

.snapshot-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(50px) scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.6);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg);
}

.modal-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
    background: #f8f9fa;
}

.modal-info {
    padding: 2rem;
    background: white;
    flex-shrink: 0;
}

.modal-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--color-text);
    font-weight: 600;
}

.modal-info p {
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: 1rem;
}

.modal-meta {
    display: flex;
    gap: 2rem;
    font-size: 0.9rem;
    color: var(--color-text-tertiary);
    margin-bottom: 1.5rem;
}

.modal-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-meta span:before {
    font-size: 1.1rem;
}

.modal-meta span:first-child:before {
    content: "📅";
}

.modal-meta span:last-child:before {
    content: "🏷️";
}

.modal-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--color-background-alt);
    border-top: 1px solid var(--color-border);
}

.nav-btn {
    padding: 0.75rem 1.5rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.nav-btn:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
}

.nav-btn:disabled {
    background: var(--color-border);
    cursor: not-allowed;
    transform: none;
    opacity: 0.5;
}

.prev-btn:before {
    content: "‹";
    font-size: 1.2rem;
}

.next-btn:after {
    content: "›";
    font-size: 1.2rem;
}

/* Zoom functionality */
.modal-image {
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.modal-image.zoomed {
    cursor: zoom-out;
    transform: scale(1.5);
}

/* Fullscreen button */
.fullscreen-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 1001;
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Loading spinner */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Image counter */
.image-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    backdrop-filter: blur(10px);
}

/* Keyboard shortcuts hint */
.keyboard-hint {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.75rem;
    opacity: 0.7;
    pointer-events: none;
}

/* Download button */
.download-btn {
    position: absolute;
    top: 1rem;
    left: 4.5rem;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    z-index: 1001;
}

.download-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

.modal-image {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    display: block;
}

.modal-info {
    padding: 1.5rem;
    background: white;
}

.modal-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.modal-info p {
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.modal-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--color-text-tertiary);
}

.modal-navigation {
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--color-background);
    border-top: 1px solid var(--color-border);
}

.nav-btn {
    padding: 0.5rem 1rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.nav-btn:hover {
    background: var(--color-primary-dark);
}

.nav-btn:disabled {
    background: var(--color-border);
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
    .viewer-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .viewer-controls {
        justify-content: center;
    }
    
    .snapshot-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .modal-navigation {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Enhanced Media Page Background Sections */
.media-section {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    position: relative;
    overflow: hidden;
}

.media-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 60"><defs><pattern id="dots" width="60" height="60" patternUnits="userSpaceOnUse"><circle cx="30" cy="30" r="1.5" fill="rgba(102, 126, 234, 0.1)"/></pattern></defs><rect width="60" height="60" fill="url(%23dots)"/></svg>');
    pointer-events: none;
}

/* Featured Case Studies Enhancement */
.featured-case-studies {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    padding: 4rem 0;
    position: relative;
}

.featured-case-studies::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 25% 25%, rgba(102, 126, 234, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 75% 75%, rgba(118, 75, 162, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* Work Snapshots Enhancement */
.work-snapshots {
    background: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%);
    position: relative;
}

.work-snapshots::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 40%, rgba(102, 126, 234, 0.02) 50%, transparent 60%);
    pointer-events: none;
}

/* Modal Styles */
.case-study-modal, .gallery-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  overflow-y: auto;
  padding: 10px;
  box-sizing: border-box;
}

.case-study-modal .modal-content, .gallery-modal .modal-content {
  background: white;
  margin: 2% auto;
  padding: 0;
  border-radius: 12px;
  max-width: 700px;
  width: 95%;
  max-height: 85vh;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  color: #666;
  cursor: pointer;
  z-index: 1001;
  background: white;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.modal-close:hover {
  color: #000;
  background: #f8f9fa;
  transform: scale(1.1);
}

/* Case Study Modal Specific Styles */
.case-study-content {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.case-study-content::-webkit-scrollbar {
  width: 6px;
}

.case-study-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.case-study-content::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.case-study-content::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.case-study-content h2 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 1.8rem;
  border-bottom: 3px solid #007bff;
  padding-bottom: 8px;
}

.case-study-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 8px;
  margin: 15px 0;
}

.case-study-details h3 {
  color: #007bff;
  margin: 25px 0 10px 0;
  font-size: 1.3rem;
}

.case-study-details p {
  line-height: 1.6;
  color: #555;
  margin-bottom: 15px;
}

.case-study-details ul {
  list-style-type: none;
  padding: 0;
}

.case-study-details li {
  padding: 8px 0;
  padding-left: 20px;
  position: relative;
  color: #555;
}

.case-study-details li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #28a745;
  font-weight: bold;
}

.case-study-tech {
  margin-top: 30px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
}

.case-study-tech h4 {
  margin: 0 0 15px 0;
  color: #333;
}

.tech-tag {
  display: inline-block;
  background: #007bff;
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  margin: 4px 6px 4px 0;
  font-weight: 500;
}

/* Gallery Modal Specific Styles */
.gallery-modal-content {
  max-width: 1000px !important;
  padding: 0 !important;
}

.gallery-modal-image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border-radius: 12px 12px 0 0;
}

.gallery-modal-image .modal-image {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 12px 12px 0 0;
}

.gallery-navigation {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  padding: 0 20px;
}

.gallery-nav-btn {
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 24px;
  cursor: pointer;
  pointer-events: all;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.gallery-nav-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

.gallery-nav-btn:active {
  transform: scale(0.95);
}

.gallery-modal-info {
  padding: 20px 30px 30px 30px;
  background: white;
  border-radius: 0 0 12px 12px;
}

.gallery-modal-info h3 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 1.5rem;
}

.gallery-modal-info p {
  color: #666;
  line-height: 1.6;
  margin: 0;
}

/* Enhanced modal styles for existing structure */
.modal-hero {
  padding: 40px 30px 30px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.modal-hero h2 {
  color: white;
  font-size: 2.2rem;
  margin: 0 0 10px 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.modal-hero p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  margin: 0;
}

.modal-body {
  padding: 30px;
}

.case-study-section {
  margin-bottom: 30px;
}

.case-study-section h3 {
  color: #667eea;
  font-size: 1.4rem;
  margin: 0 0 15px 0;
  font-weight: 600;
}

.case-study-section p {
  color: #555;
  line-height: 1.7;
  margin: 0;
}

.solution-list {
  list-style: none;
  padding: 0;
  margin: 15px 0 0 0;
}

.solution-list li {
  padding: 8px 0 8px 25px;
  position: relative;
  color: #555;
  line-height: 1.6;
}

.solution-list li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #28a745;
  font-weight: bold;
  font-size: 1.1rem;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.result-item {
  text-align: center;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 2px solid #e9ecef;
  transition: all 0.3s ease;
}

.result-item:hover {
  border-color: #667eea;
  transform: translateY(-2px);
}

.result-number {
  font-size: 2.5rem;
  font-weight: bold;
  color: #667eea;
  margin-bottom: 8px;
}

.result-label {
  color: #666;
  font-size: 0.9rem;
  font-weight: 500;
}

.case-study-tech {
  background: #f8f9fa;
  padding: 25px;
  border-radius: 12px;
  margin-top: 30px;
}

.case-study-tech h4 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 1.2rem;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-tag {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-block;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .case-study-modal .modal-content, .gallery-modal .modal-content {
    margin: 5px auto;
    width: 98%;
    max-height: 90vh;
  }
  
  .case-study-content {
    padding: 15px;
    max-height: 75vh;
  }
  
  .case-study-content h2 {
    font-size: 1.4rem;
  }
  
  .case-study-image {
    height: 180px;
  }
  
  .modal-close {
    top: 8px;
    right: 12px;
    width: 32px;
    height: 32px;
    font-size: 20px;
  }
  
  .gallery-modal .modal-info {
    padding: 12px 15px 15px 15px;
  }
  
  .modal-hero h2 {
    font-size: 1.6rem;
  }
  
  .modal-hero p {
    font-size: 0.95rem;
  }
  
  .modal-body {
    padding: 15px;
  }
  
  .case-study-section h3 {
    font-size: 1.1rem;
    margin: 15px 0 8px 0;
  }
  
  .case-study-section p {
    font-size: 0.9rem;
    line-height: 1.4;
  }
  
  .results-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .result-number {
    font-size: 2rem;
  }
  
  .gallery-nav-btn {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  
  .gallery-navigation {
    padding: 0 15px;
  }
}