/* Components CSS - Reusable component styles */

/* Pinterest-style masonry layout */
.pinterest-masonry {
  column-count: 4;
  column-gap: 1.5rem;
  column-fill: balance;
}

@media (max-width: 1024px) {
  .pinterest-masonry {
    column-count: 2;
    column-gap: 1rem;
  }
}

@media (max-width: 640px) {
  .pinterest-masonry {
    column-count: 1;
    column-gap: 0;
  }
  
  .pinterest-card {
    margin-bottom: 2rem;
  }
  
  .pinterest-masonry > a {
    margin-bottom: 2rem;
    display: block;
  }
}

.pinterest-card {
  break-inside: avoid;
  margin-bottom: 1.5rem;
  display: inline-block;
  width: 100%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
  will-change: transform, opacity, box-shadow;
}

.pinterest-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.dark .pinterest-card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.pinterest-image {
  width: 100%;
  border-radius: 0.75rem;
  margin-bottom: 0.75rem;
}

.pinterest-content {
  padding: 0.75rem;
}

.pinterest-title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.25rem;
  color: #1f2937;
}

.dark .pinterest-title {
  color: #f9fafb;
}

.pinterest-meta {
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.4;
}

.dark .pinterest-meta {
  color: #9ca3af;
}

/* Project filter tabs */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  justify-content: flex-start;
  position: relative;
}

.filter-tabs::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: var(--underline-left, 0px);
  width: var(--underline-width, 0px);
  height: 2px;
  background: #1f2937;
  transition: all 0.3s ease-out;
  z-index: 1;
}

.dark .filter-tabs::after {
  background: #f9fafb;
}

.filter-tab {
  padding: 0.5rem 0 0.5rem 0;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease-out;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: #6b7280;
  text-align: left;
  margin-right: 1rem;
  position: relative;
  z-index: 2;
}

.dark .filter-tab {
  color: #9ca3af;
}

.filter-tab:hover {
  background: transparent;
  color: #374151;
  font-weight: 600;
}

.dark .filter-tab:hover {
  background: transparent;
  color: #f9fafb;
  font-weight: 600;
}

.filter-tab.active {
  background: transparent;
  color: #1f2937;
  border-color: transparent;
  border-radius: 0;
  font-weight: 600;
}

.dark .filter-tab.active {
  background: transparent;
  color: #f9fafb;
  border-color: transparent;
  font-weight: 600;
}

/* Project like counter */
.project-like-counter {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 1rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.2s ease-out;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
}

.dark .project-like-counter {
  background: rgba(31, 41, 55, 0.9);
  color: #9ca3af;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pinterest-card:hover .project-like-counter {
  opacity: 1;
  transform: scale(1);
}

.project-like-counter:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 1);
}

.dark .project-like-counter:hover {
  background: rgba(31, 41, 55, 1);
}

.project-like-counter.liked {
  background: rgba(236, 72, 153, 0.2);
  color: #ec4899;
}

.dark .project-like-counter.liked {
  background: rgba(236, 72, 153, 0.3);
}

.project-like-counter.liked:hover {
  background: rgba(236, 72, 153, 0.3);
}

.dark .project-like-counter.liked:hover {
  background: rgba(236, 72, 153, 0.4);
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  border-radius: 0.375rem;
  border: 1px solid rgb(229 231 235);
  overflow: hidden;
}

.dark .theme-toggle {
  border-color: rgb(55 65 81);
}

.theme-toggle button {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  transition: all 0.2s ease-out;
  border: none;
  background: transparent;
  cursor: pointer;
}

.theme-toggle button.active {
  background: rgb(17 24 39);
  color: white;
}

.dark .theme-toggle button.active {
  background: white;
  color: rgb(17 24 39);
}

.theme-toggle button:not(.active) {
  background: white;
  color: rgb(107 114 128);
}

.dark .theme-toggle button:not(.active) {
  background: rgb(31 41 55);
  color: rgb(209 213 219);
}

.theme-toggle button:not(.active):hover {
  background: rgb(249 250 251);
}

.dark .theme-toggle button:not(.active):hover {
  background: rgb(55 65 81);
}

/* Music Player */
.music-player-compact {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  border-radius: 9999px;
  padding: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border: 1px solid rgb(229 231 235);
  transition: all 0.3s ease-out;
}

.dark .music-player-compact {
  background: rgba(31, 41, 55, 0.9);
  border-color: rgb(55 65 81);
}

.music-player-compact:hover {
  background: white;
}

.dark .music-player-compact:hover {
  background: rgb(31 41 55);
}

.music-player-expanded {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid rgb(229 231 235);
  width: 20rem;
}

.dark .music-player-expanded {
  background: rgba(31, 41, 55, 0.95);
  border-color: rgb(55 65 81);
}

.music-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.music-play-button {
  width: 2rem;
  height: 2rem;
  background: #5366ff;
  color: white;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease-out;
}

.music-play-button:hover {
  background: #3a49db;
}

.music-volume-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.music-volume-slider {
  flex: 1;
  height: 0.25rem;
  background: rgb(229 231 235);
  border-radius: 0.5rem;
  appearance: none;
  cursor: pointer;
}

.dark .music-volume-slider {
  background: rgb(55 65 81);
}

.music-volume-slider::-webkit-slider-thumb {
  appearance: none;
  width: 1rem;
  height: 1rem;
  background: #5366ff;
  border-radius: 50%;
  cursor: pointer;
}

.music-volume-slider::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  background: #5366ff;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.music-track-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.music-track-item {
  width: 100%;
  text-align: left;
  padding: 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  transition: all 0.2s ease-out;
  border: none;
  background: transparent;
  cursor: pointer;
}

.music-track-item:hover {
  background: rgb(243 244 246);
}

.dark .music-track-item:hover {
  background: rgb(55 65 81);
}

.music-track-item.active {
  background: rgba(83, 102, 255, 0.1);
  color: #3a49db;
}

.dark .music-track-item.active {
  background: rgba(83, 102, 255, 0.2);
  color: #aab8ff;
}

/* Drawing Canvas */
.drawing-canvas {
  width: 100%;
  height: 24rem;
  border: 2px solid rgb(229 231 235);
  border-radius: 0.5rem;
  cursor: crosshair;
  background: white;
}

.dark .drawing-canvas {
  border-color: rgb(55 65 81);
  background: rgb(31 41 55);
}

.drawing-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.drawing-color-palette {
  display: flex;
  gap: 0.5rem;
}

.drawing-color-button {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid rgb(209 213 219);
  transition: all 0.2s ease-out;
  cursor: pointer;
}

.dark .drawing-color-button {
  border-color: rgb(75 85 99);
}

.drawing-color-button.active {
  border-color: rgb(17 24 39);
  transform: scale(1.1);
}

.dark .drawing-color-button.active {
  border-color: rgb(229 231 235);
}

.drawing-brush-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.drawing-brush-slider {
  width: 5rem;
}

.drawing-action-buttons {
  display: flex;
  gap: 0.25rem;
}

.drawing-button {
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: all 0.2s ease-out;
  border: 1px solid rgb(209 213 219);
  background: white;
  color: rgb(107 114 128);
  cursor: pointer;
}

.dark .drawing-button {
  border-color: rgb(75 85 99);
  background: rgb(31 41 55);
  color: rgb(209 213 219);
}

.drawing-button:hover:not(:disabled) {
  background: rgb(249 250 251);
}

.dark .drawing-button:hover:not(:disabled) {
  background: rgb(55 65 81);
}

.drawing-button:disabled {
  background: rgb(243 244 246);
  color: rgb(156 163 175);
  cursor: not-allowed;
}

.dark .drawing-button:disabled {
  background: rgb(31 41 55);
  color: rgb(75 85 99);
}

.drawing-button.primary {
  background: #dc2626;
  color: white;
  border-color: #dc2626;
}

.drawing-button.primary:hover {
  background: #b91c1c;
}

/* Kudos Section */
.kudos-section {
  padding: 4rem 0;
}

.kudos-notes-container {
  position: relative;
  min-height: 25rem;
  user-select: none;
}

.kudos-note {
  position: absolute;
  padding: 1rem;
  border-radius: 0.5rem;
  border: 2px solid;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease-out;
  max-width: 12.5rem;
  cursor: grab;
}

.kudos-note:hover {
  transform: scale(1.05);
}

.kudos-note.dragging {
  z-index: 20;
  transform: scale(1.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  cursor: grabbing;
}

.kudos-note.editing {
  z-index: 10;
  transform: scale(1.05);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  cursor: default;
}

.kudos-note-content {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(31 41 55);
  margin-bottom: 0.5rem;
}

.dark .kudos-note-content {
  color: rgb(229 231 235);
}

.kudos-note-meta {
  font-size: 0.75rem;
  color: rgb(107 114 128);
}

.dark .kudos-note-meta {
  color: rgb(156 163 175);
}

.kudos-note-author {
  font-weight: 500;
}

.kudos-note-date {
  margin-top: 0.25rem;
}

.kudos-note-delete {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  opacity: 0;
  transition: opacity 0.2s ease-out;
  width: 1.25rem;
  height: 1.25rem;
  background: rgb(107 114 128);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  border: none;
  cursor: pointer;
}

.kudos-note:hover .kudos-note-delete {
  opacity: 1;
}

.kudos-note-delete:hover {
  background: rgb(75 85 99);
}

.kudos-note-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.kudos-note-form input,
.kudos-note-form textarea {
  padding: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: transparent;
  border-bottom: 1px solid rgb(156 163 175);
  outline: none;
  resize: none;
}

.kudos-note-form input:focus,
.kudos-note-form textarea:focus {
  border-bottom-color: rgb(75 85 99);
}

.dark .kudos-note-form input:focus,
.dark .kudos-note-form textarea:focus {
  border-bottom-color: rgb(209 213 219);
}

.kudos-note-form textarea {
  font-size: 0.875rem;
  border: none;
  font-weight: 400;
}

.kudos-note-form-actions {
  display: flex;
  justify-content: flex-end;
}

.kudos-note-save-button {
  padding: 0.25rem 0.75rem;
  background: #10b981;
  color: white;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease-out;
}

.kudos-note-save-button:hover {
  background: #059669;
}

.kudos-note-cancel-button {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  width: 1.5rem;
  height: 1.5rem;
  background: rgb(107 114 128);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease-out;
  z-index: 10;
}

.kudos-note-cancel-button:hover {
  background: rgb(75 85 99);
}

/* Poster Wall */
.poster-wall {
  position: relative;
  min-height: 25rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 1rem;
  padding: 2rem;
  margin: 2rem 0;
}

.dark .poster-wall {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.poster-item {
  position: absolute;
  transition: all 0.3s ease-out;
  cursor: pointer;
  transform-origin: center;
}

.poster-item:hover {
  transform: scale(1.05) !important;
  z-index: 10;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.dark .poster-item:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.poster-pin {
  position: absolute;
  top: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1rem;
  height: 1rem;
  background: #dc2626;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 5;
}

/* Click hearts container */
#click-hearts {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* Masonry animation classes */
.masonry-item-enter {
  opacity: 0;
  transform: scale(0.8) translateY(20px);
}

.masonry-item-enter-active {
  opacity: 1;
  transform: scale(1) translateY(0);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.masonry-item-exit {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.masonry-item-exit-active {
  opacity: 0;
  transform: scale(0.8) translateY(-20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Lazy loading animation */
.pinterest-card[data-lazy] {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

.pinterest-card[data-lazy].loaded {
  opacity: 1;
  transform: translateY(0);
}

/* Scroll animations */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-animate.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animations */
.stagger-animate > * {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-animate.animate-in > * {
  opacity: 1;
  transform: translateY(0);
}

/* Parallax elements */
[data-parallax] {
  will-change: transform;
}

/* Toast animations */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

/* High contrast mode */
.high-contrast {
  --text-primary: #000000;
  --text-secondary: #333333;
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --border-color: #000000;
}

.dark.high-contrast {
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --bg-primary: #000000;
  --bg-secondary: #1a1a1a;
  --border-color: #ffffff;
}

/* Focus visible styles */
.focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #000;
  color: #fff;
  padding: 8px;
  text-decoration: none;
  z-index: 10000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 6px;
}

.poster-pin::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0.375rem;
  height: 0.375rem;
  background: #fef2f2;
  border-radius: 50%;
}

.poster-shadow {
  position: absolute;
  bottom: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 0.5rem;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  filter: blur(4px);
}

.dark .poster-shadow {
  background: rgba(0, 0, 0, 0.3);
}
