/*
  Projects Showcase - Light Mode
  © 2025 Miloš Sarić. All rights reserved.
  Integrates with existing global CSS variables
*/

/* Projects Section */
.projects-section {
  min-height: 80vh;
  padding: 4rem 2rem;
  background: var(--bg-primary, #ffffff);
}

.projects-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* Header */
.projects-header {
  text-align: center;
  margin-bottom: 3rem;
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.projects-header h1 {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-primary, #0d0d0d);
  margin: 0 0 1rem 0;
  letter-spacing: -0.02em;
}

.projects-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary, #676767);
  margin: 0 0 2rem 0;
  font-weight: 400;
}

/* Random Project Button */
.random-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #10a37f 0%, #0d8c6d 100%);
  color: white;
  border: none;
  padding: 0.875rem 1.75rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  animation: fadeIn 0.6s ease-out 0.2s backwards;
}

.random-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.random-btn:active {
  transform: translateY(0);
}

.random-btn svg {
  transition: transform 0.3s ease;
}

.random-btn:hover svg {
  transform: rotate(180deg);
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  animation: fadeIn 0.6s ease-out 0.4s backwards;
}

/* Project Card */
.project-card {
  background: var(--card-bg, #ffffff);
  border: 2px solid #d1d1d1;
  border-radius: 16px;
  padding: 2rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Coming Soon Card */
.project-card.coming-soon {
  cursor: default;
  opacity: 0.85;
  border-style: dashed;
  border-color: #10a37f;
}

.project-card.coming-soon:hover {
  transform: translateY(-4px);
  opacity: 1;
}

.project-card.coming-soon .project-icon {
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.project-card.coming-soon .project-tag {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.3);
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.project-card:hover::before {
  transform: scaleX(1);
}

.project-card:hover {
  border-color: #10a37f;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  transform: translateY(-8px);
}

/* Project Card Content */
.project-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #10a37f 0%, #0d8c6d 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
  transition: transform 0.3s ease;
}

.project-card:hover .project-icon {
  transform: scale(1.1) rotate(5deg);
}

.project-icon svg {
  width: 28px;
  height: 28px;
  color: white;
  stroke: white;
  fill: none;
}

.project-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.75rem 0;
  line-height: 1.3;
}

.project-description {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 1.5rem 0;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.project-tag {
  background: rgba(16, 163, 127, 0.1);
  color: var(--accent);
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid rgba(16, 163, 127, 0.2);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #10a37f;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: gap 0.3s ease, color 0.3s ease;
  text-decoration: none;
}

.project-card:hover .project-link {
  gap: 0.75rem;
  color: #0d8c6d;
}

.project-link svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
  stroke: currentColor;
  fill: none;
}

.project-card:hover .project-link svg {
  transform: translateX(4px);
}

/* Loading State */
.loading-state {
  text-align: center;
  padding: 4rem 2rem;
  animation: fadeIn 0.3s ease-out;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.5rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-state p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Highlight Animation for Random Project */
@keyframes highlightPulse {
  0%, 100% {
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(16, 163, 127, 0.2), var(--shadow-lg);
    border-color: var(--accent);
    transform: scale(1.02);
  }
}

.project-card.highlight {
  animation: highlightPulse 1.5s ease-in-out 3;
}

/* Responsive Design */
@media (max-width: 768px) {
  .projects-section {
    padding: 2rem 1rem;
  }

  .projects-header h1 {
    font-size: 2rem;
  }

  .projects-subtitle {
    font-size: 1rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .project-card {
    padding: 1.5rem;
  }

  .random-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
  }
}

@media (max-width: 480px) {
  .projects-header h1 {
    font-size: 1.75rem;
  }

  .projects-subtitle {
    font-size: 0.9375rem;
  }

  .project-title {
    font-size: 1.25rem;
  }

  .project-description {
    font-size: 0.9375rem;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}