
/* ## HEADER STICKY FIX */

html {
  scroll-behavior: smooth;
}

/* Override the sticky navbar to prevent topbar overlap */
.navbar-sticky-top {
  position: sticky !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  background-color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease;
}

/* Ensure the topbar also has a background */
.navbar {
  background-color: #ffffff !important;
}

/* Image card overlay for better text contrast */
.bg-img-start {
  min-height: 25rem;
  background-size: cover;
  background-position: center;
  position: relative;
}

.bg-img-start::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.4) 100%);
  z-index: 1;
  border-radius: inherit;
}

.bg-img-start .card-body {
  position: relative;
  z-index: 2;
}

/* Additional text shadow for better readability */
.bg-img-start .card-title,
.bg-img-start .card-text,
.bg-img-start .card-link {
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

/* Chevrons for navigation summary */
.breadcrumb-item + .breadcrumb-item::before {
    content: '\f101';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    padding-right: 0.5rem;
}
/* ## PHOTOS */

/* Instagram-style Grid Layout */
  .photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    padding: 0;
  }
  
  .photo-grid-item {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-in-out;
  }
  
  .photo-grid-item.loaded {
    opacity: 1;
    transform: translateY(0);
  }
  
  .photo-container {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* 1:1 Aspect Ratio */
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    background: #f8f9fa;
  }
  
  .photo-container:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15);
  }
  
  .photo-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
  }
  
  .photo-container:hover .photo-img {
    transform: scale(1.05);
  }
  
  .photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.7), transparent 60%);
    color: white;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
  }
  
  .photo-container:hover .photo-overlay {
    opacity: 1;
  }
  
  .photo-overlay-content h6 {
    color: white;
    font-weight: 600;
    margin-bottom: 0.25rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  }
  
  .photo-overlay-meta {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  }
  
  .loading-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 2s infinite;
    border-radius: 0.75rem;
  }
  
  @keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }
  
  /* Image Modal Styles */
  .image-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .image-modal.show {
    opacity: 1;
  }
  
  .image-modal-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .image-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
  }
  
  .image-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
  }
  
  .image-modal-body {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    max-width: 95vw;
    max-height: 95vh;
    gap: 0;
  }
  
  .modal-image {
    max-width: 70vw;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 0.5rem 0 0 0.5rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.5);
    display: block;
  }
  
  .image-modal-info {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 0 0.5rem 0.5rem 0;
    padding: 5rem 1.5rem 1.5rem 1.5rem;
    width: 280px;
    min-width: 240px;
    max-height: 95vh;
    overflow-y: auto;
    text-align: left;
    color: #333;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    /* padding-top: 5%; */
  }
  
  .image-modal-meta {
    color: #666;
  }
  
  .image-modal-tech {
    color: #888;
  }
  
  .image-modal-nav {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: calc(100% - 280px);
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
    pointer-events: none;
  }
  
  .nav-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: all;
    font-size: 1.2rem;
    color: #333;
  }
  
  .nav-btn:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
  }
  
  .nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
  }
  
  /* Responsive Design */
  @media (max-width: 768px) {
    .photo-grid {
      grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
      gap: 0.5rem;
    }
    
    .photo-overlay {
      opacity: 1;
      background: linear-gradient(transparent 50%, rgba(0, 0, 0, 0.8));
    }
    
    .image-modal-content {
      max-width: 100vw;
      max-height: 100vh;
    }

    .image-modal-body {
      flex-direction: column;
      align-items: center;
      max-height: 100vh;
      overflow-y: auto;
    }

    .modal-image {
      max-width: 100vw;
      max-height: 60vh;
      border-radius: 0.5rem 0.5rem 0 0;
    }

    .image-modal-info {
      border-radius: 0 0 0.5rem 0.5rem;
      width: 100%;
      min-width: unset;
      max-height: unset;
      overflow-y: visible;
      text-align: center;
      padding: 1rem;
    }
    
    .image-modal-close {
      top: 10px;
      right: 10px;
    }
    
    .nav-btn {
      width: 40px;
      height: 40px;
      font-size: 1rem;
    }
    
    .image-modal-nav {
      width: 100%;
      padding: 0 10px;
    }
  }
  
  @media (max-width: 480px) {
    .photo-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 0.25rem;
    }
  }
  
  @media (min-width: 1200px) {
    .photo-grid {
      grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
      gap: 1.5rem;
    }
  }
  
  /* Share Modal Styles */
  .share-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .share-modal.show {
    opacity: 1;
  }
  
  .share-modal-content {
    background: white;
    border-radius: 0.5rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
  }
  
  .share-modal.show .share-modal-content {
    transform: scale(1);
  }
  
  .share-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  .share-modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
  }
  
  .share-modal-close {
    color: #aaa;
    font-size: 1.75rem;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
  }
  
  .share-modal-close:hover {
    color: #000;
  }
  
  .share-modal-body {
    padding: 1.5rem;
  }
  
  .share-input-group {
    display: flex;
    gap: 0.5rem;
  }
  
  .share-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: #f8f9fa;
  }
  
  .share-copy-btn {
    padding: 0.75rem 1.5rem;
    background-color: #6c757d;
    color: white;
    border: 1px solid #6c757d;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
  }
  
  .share-copy-btn:hover {
    background-color: #5a6268;
  }
  
  .share-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
  }
  
  .share-close-btn {
    padding: 0.5rem 1.5rem;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
  }
  
  .share-close-btn:hover {
    background-color: #5a6268;
  }
  
  .spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: text-bottom;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
  }
  
  @keyframes spinner-border {
    to { transform: rotate(360deg); }
  }
  
  
  /* Alerts */
  .alert {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
  }
  
  .alert-success {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
  }
  
  .alert-danger {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
  }

/* Like button style */
.like-btn {
  background: rgba(0,0,0,.35);
  border: none;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 5px 9px;
  border-radius: 50%;
  line-height: 1;
  transition: transform .2s ease, background .2s ease;
  flex-shrink: 0;
}
.like-btn:hover { transform: scale(1.25); background: rgba(0,0,0,.55); }
.like-btn .fa-solid.fa-heart { color: var(--bs-primary); }

.modal-like-btn {
  background: none;
  border: none;
  padding: 2px 4px;
  cursor: pointer;
  font-size: 1.3rem;
  color: #aaa;
  line-height: 1;
  transition: transform .15s ease, color .15s ease;
  flex-shrink: 0;
}
.modal-like-btn:hover { transform: scale(1.2); color: var(--bs-primary); }
.modal-like-btn.liked { color: var(--bs-primary); }

.modal-like-count {
  font-size: 0.85rem;
  color: #666;
  font-weight: 500;
  align-self: center;
  margin-left: -4px;
}
.modal-like-count-readonly {
  font-size: 0.85rem;
  color: #666;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 4px;
}