/* ==========================================================================
   Projects Section — styles for projectsSection.php
   ========================================================================== */

/* --------------------------------------------------------------------------
   Section-title masks (shared pattern across sections)
   -------------------------------------------------------------------------- */
.leftmask   { transform: translateX(0); }
.rightmask  { transform: translateX(0); }
.topmask    { transform: translateY(0); }
.bottommask { transform: translateY(0); }

/* --------------------------------------------------------------------------
   Project card base
   -------------------------------------------------------------------------- */
.project-card { max-width: 420px; width: 100%; margin: 0 auto; }
.project-card.atiera-card {
  contain: none;
  overflow: visible !important;
}

/* Ribbon badge (was inline style="" on each ATIERA card) */
.project-ribbon {
  pointer-events: none;
  position: absolute;
  z-index: 30;
  display: flex;
  height: 30px;
  width: 170px;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  border-top: 1px solid rgba(156, 163, 175, 0.7);
  border-bottom: 1px solid rgba(156, 163, 175, 0.7);
  border-left: 2px dashed rgba(156, 163, 175, 0.45);
  border-right: 2px dashed rgba(156, 163, 175, 0.45);
  background-color: rgba(229, 231, 235, 0.65);
  padding: 0 8px;
  text-align: center;
  font-size: 7px;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1;
  letter-spacing: 0.18em;
  color: #1f2937;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(2px);
  top: -14px;
  left: -20px;
  transform: rotate(-25deg);
  background-image: linear-gradient(135deg,
    rgba(255, 255, 255, 0.28) 0%,
    rgba(255, 255, 255, 0.12) 30%,
    rgba(255, 255, 255, 0.16) 30%,
    rgba(255, 255, 255, 0.05) 100%);
}
.dark .project-ribbon {
  border-top-color: rgba(107, 114, 128, 0.25);
  border-bottom-color: rgba(107, 114, 128, 0.25);
  border-left-color: rgba(156, 163, 175, 0.3);
  border-right-color: rgba(156, 163, 175, 0.3);
  background-color: rgba(55, 65, 81, 0.2);
  color: #d1d5db;
}

/* Font Awesome icon sizing inside tooltips */
.icon-font-awesome { font-size: 1.5rem; }

/* --------------------------------------------------------------------------
   Click-follow overlay (was set up via JS adding these classes)
   -------------------------------------------------------------------------- */
.click-follow-overlay { position: absolute; inset: 0; display: block; }
.click-follow-text {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: transform 80ms ease, opacity 150ms ease;
}

/* --------------------------------------------------------------------------
   Toolbar — search, filters, labels
   -------------------------------------------------------------------------- */
.project-toolbar-label {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.project-filter-btn {
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.7);
  color: #1f2937;
  border-radius: 9999px;
  padding: 0.55rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.project-filter-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 0, 0, 0.4);
}
.project-filter-btn.is-active {
  background: #000;
  border-color: #000;
  color: #fff;
  box-shadow: 0 10px 25px -15px rgba(0, 0, 0, 0.5);
}
.dark .project-filter-btn {
  background: rgba(31, 41, 55, 0.72);
  color: #f9fafb;
  border-color: rgba(107, 114, 128, 0.45);
}
.dark .project-filter-btn.is-active {
  background: #fff;
  border-color: #fff;
  color: #000;
}
.project-search-input::placeholder { color: #6b7280; }
.dark .project-search-input::placeholder { color: #9ca3af; }

/* --------------------------------------------------------------------------
   Lazy image loading states (project cards)
   -------------------------------------------------------------------------- */
.project-card .lazy-image {
  opacity: 0;
  transition: opacity 0.45s ease-in-out, filter 0.45s ease-in-out, transform 0.45s ease-in-out;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(0, 0, 0, 0.22)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 25%, rgba(255, 255, 255, 0.18) 50%, rgba(255, 255, 255, 0.08) 75%);
  background-size: cover, 200% 100%;
  filter: blur(7px);
}
.project-card .lazy-image:not(.loaded) {
  animation: project-shimmer 1.6s linear infinite;
}
.project-card .lazy-image.loaded {
  opacity: 1;
  background: transparent;
  filter: blur(0);
  animation: fadeInProjectImage 0.55s ease-in-out;
}

@keyframes project-shimmer {
  0%   { background-position: 50% 50%, 200% 0; }
  100% { background-position: 50% 50%, -200% 0; }
}
@keyframes fadeInProjectImage {
  from { opacity: 0; transform: scale(0.965); }
  to   { opacity: 1; transform: scale(1); }
}

/* Generic lazy image (used outside .project-card too) */
.lazy-image {
  opacity: 0;
  transition: opacity 0.5s ease-in-out, filter 0.5s ease-in-out;
  background: #f0f0f0;
  filter: blur(8px);
}
.lazy-image.loaded {
  opacity: 1;
  background: transparent;
  filter: blur(0px);
}
.lazy-image:not(.loaded) {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}
@keyframes skeleton-loading {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.dark .lazy-image:not(.loaded) {
  background: linear-gradient(90deg, #2d3748 25%, #4a5568 50%, #2d3748 75%);
  background-size: 200% 100%;
}
.lazy-image.loaded {
  animation: fadeInImage 0.6s ease-in-out;
}
@keyframes fadeInImage {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

/* img.lazy-image variant used inside the grid */
img.lazy-image {
  opacity: 0;
  transition: opacity 0.5s ease-in-out, filter 0.5s ease-in-out;
}
img.lazy-image.loaded { opacity: 1; }

/* --------------------------------------------------------------------------
   Viewer image loading state
   -------------------------------------------------------------------------- */
#viewerImage.loading {
  opacity: 0.3;
  filter: blur(10px);
  transition: opacity 0.3s ease, filter 0.3s ease;
}
#viewerImage.loaded {
  opacity: 1;
  filter: blur(0px);
}

/* --------------------------------------------------------------------------
   Custom animations
   -------------------------------------------------------------------------- */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideLeft {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}
@keyframes slideRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
@keyframes slideTop {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}
@keyframes slideBottom {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes pulseGlow {
  0%, 100% { text-shadow: 0 0 10px rgba(0, 0, 0, 0.3); }
  50%      { text-shadow: 0 0 20px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 0, 0, 0.3); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes cardFloat {
  0%   { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

.animate-fadeInDown  { animation: fadeInDown 1s ease forwards; }
.animate-fadeInUp    { animation: fadeInUp 1s ease forwards; }
.animate-fadeIn      { animation: fadeIn 0.5s ease forwards; }
.animate-slideLeft   { animation: slideLeft 0.8s ease forwards; }
.animate-slideRight  { animation: slideRight 0.8s ease forwards; }
.animate-slideTop    { animation: slideTop 0.8s ease forwards; }
.animate-slideBottom { animation: slideBottom 0.8s ease forwards; }
.animate-pulse-glow  { animation: pulseGlow 2s ease-in-out infinite; }
.animate-scaleIn     { animation: scaleIn 0.3s ease forwards; }
.animate-card        { animation: cardFloat 0.7s ease forwards; }

.animation-delay-100 { animation-delay: 100ms; }
.animation-delay-200 { animation-delay: 200ms; }
.animation-delay-300 { animation-delay: 300ms; }
.animation-delay-400 { animation-delay: 400ms; }
.animation-delay-500 { animation-delay: 500ms; }
.animation-delay-600 { animation-delay: 600ms; }
.animation-delay-700 { animation-delay: 700ms; }
.animation-delay-800 { animation-delay: 800ms; }

/* --------------------------------------------------------------------------
   Tooltips
   -------------------------------------------------------------------------- */
.tooltip {
  position: relative;
  display: inline-block;
}
.tooltip .tooltip-text {
  visibility: hidden;
  width: max-content;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 4px;
  padding: 4px 8px;
  position: absolute;
  z-index: 10;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  white-space: nowrap;
  font-size: 0.75rem;
  pointer-events: none;
}
.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}
.tooltip .tooltip-text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

/* --------------------------------------------------------------------------
   Card hover + drag states
   -------------------------------------------------------------------------- */
.project-card {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  will-change: transform, opacity;
  contain: layout paint;
}
.project-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.project-card-chosen { background-color: #f0f0f0; }
.dark .project-card-chosen { background-color: #333; }
.project-card-drag {
  transform: scale(1.05) rotate(1deg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  opacity: 0;
}

/* --------------------------------------------------------------------------
   Pagination buttons
   -------------------------------------------------------------------------- */
#pagination button {
  transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}
#pagination button:hover:not(:disabled) {
  transform: scale(1.1);
  background-color: #e0e0e0;
  color: #1f2937;
}
#pagination button:active:not(:disabled) {
  transform: scale(0.95);
}

/* --------------------------------------------------------------------------
   Fullscreen viewer
   -------------------------------------------------------------------------- */
#fullscreenViewer {
  backdrop-filter: blur(8px);
}