/* ========================================
   Button Component Stylesheet
   ======================================== */

/* Base Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  font-family: var(--font-primary);
  text-decoration: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

/* Button Sizes */
.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* Primary Button */
.btn-primary {
  background: var(--primary-medium);
  color: var(--white);
  box-shadow: 0 4px 15px rgba(82, 121, 111, 0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(27, 67, 50, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(27, 67, 50, 0.3);
}

/* Secondary Button */
.btn-secondary {
  background: var(--primary-light);
  color: var(--white);
  box-shadow: 0 4px 15px rgba(132, 169, 140, 0.3);
}

.btn-secondary:hover {
  background: var(--primary-medium);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(82, 121, 111, 0.4);
}

/* Outline Button */
.btn-outline {
  background: transparent;
  color: var(--primary-medium);
  border: 2px solid var(--primary-medium);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--primary-medium);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(82, 121, 111, 0.3);
}

/* Outline Light (for dark backgrounds) */
.btn-outline-light {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--white);
}

.btn-outline-light:hover {
  background: var(--white);
  color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
}

/* Text Button */
.btn-text {
  background: none;
  color: var(--primary-medium);
  padding: 0.5rem 1rem;
  box-shadow: none;
  border: none;
}

.btn-text:hover {
  color: var(--primary-dark);
  background: rgba(27, 67, 50, 0.05);
  transform: none;
  box-shadow: none;
}

/* Icon Button */
.btn-icon {
  padding: 0.75rem;
  width: 45px;
  height: 45px;
  border-radius: 50%;
}

.btn-icon.btn-small {
  width: 35px;
  height: 35px;
  padding: 0.5rem;
}

.btn-icon.btn-large {
  width: 55px;
  height: 55px;
  padding: 1rem;
}

/* Button with Icon */
.btn i {
  font-size: 1em;
  transition: transform 0.3s ease;
}

.btn:hover i {
  transform: translateX(3px);
}

.btn-icon:hover i {
  transform: rotate(15deg);
}

/* Loading State */
.btn.loading {
  color: transparent;
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  animation: spin 0.8s linear infinite;
}

.btn-outline.loading::after,
.btn-text.loading::after {
  border-color: rgba(27, 67, 50, 0.3);
  border-top-color: var(--primary-dark);
}

/* Disabled State */
.btn:disabled,
.btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Button Group */
.btn-group {
  display: inline-flex;
  gap: 0;
  border-radius: 6px;
  overflow: hidden;
}

.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-group .btn-outline:not(:last-child) {
  border-right: 1px solid var(--primary-medium);
}

/* Filter Buttons */
.filter-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin: 2rem 0;
}

.filter-btn {
  padding: 0.625rem 1.25rem;
  background: var(--white);
  color: var(--gray);
  border: 2px solid var(--light-gray);
  border-radius: 25px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary-medium);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(27, 67, 50, 0.1);
}

.filter-btn.active {
  background: var(--primary-medium);
  color: var(--white);
  border-color: var(--primary-medium);
  box-shadow: 0 4px 15px rgba(82, 121, 111, 0.3);
}

.filter-btn i {
  font-size: 0.875rem;
}

/* CTA Buttons */
.cta-button {
  text-align: center;
  margin: 2rem 0;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Social Buttons */
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--off-white);
  color: var(--dark-gray);
  border-radius: 6px;
  transition: all 0.3s ease;
  text-decoration: none;
}

.social-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.social-link.linkedin:hover {
  background: #0077b5;
  color: white;
}

.social-link.twitter:hover {
  background: #1da1f2;
  color: white;
}

.social-link.researchgate:hover {
  background: #00d0af;
  color: white;
}

/* Download Buttons */
.download-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--white);
  border: 2px solid var(--light-gray);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.download-item:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(27, 67, 50, 0.1);
}

.download-icon {
  width: 50px;
  height: 50px;
  background: var(--primary-light);
  color: var(--white);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* Play Button */
.play-btn {
  width: 60px;
  height: 60px;
  background: var(--primary-medium);
  color: var(--white);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(82, 121, 111, 0.4);
}

.play-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(27, 67, 50, 0.5);
}

.play-btn i {
  font-size: 1.25rem;
  margin-left: 3px;
}

/* Expand Button */
.expand-btn {
  color: var(--primary-medium);
  background: none;
  border: none;
  padding: 0.5rem 0;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.expand-btn:hover {
  color: var(--primary-dark);
  gap: 0.75rem;
}

/* Close Button */
.close-btn,
.close-player {
  width: 35px;
  height: 35px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.close-btn:hover,
.close-player:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: rotate(90deg);
}

/* Submit Button */
button[type="submit"] {
  margin-top: 1rem;
}

/* Load More Button */
.load-more-container {
  text-align: center;
  margin: 3rem 0;
}

#loadMoreMedia,
#loadMorePubs {
  position: relative;
}

.loading-indicator {
  display: none;
  margin-top: 1rem;
}

.loading-indicator.active {
  display: block;
}

/* Button Ripple Effect */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple span {
  position: relative;
  z-index: 1;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: scale(0);
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Floating Action Button */
.fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  background: var(--primary-medium);
  color: white;
  border: none;
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(82, 121, 111, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  z-index: 100;
}

.fab i {
  font-size: 20px;
  color: white;
}

.fab:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
  box-shadow: 0 8px 30px rgba(27, 67, 50, 0.5);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .btn {
    font-size: 0.95rem;
    padding: 0.625rem 1.25rem;
  }

  .btn-large {
    padding: 0.875rem 1.75rem;
    font-size: 1.05rem;
  }

  .fab {
    width: 50px;
    height: 50px;
    bottom: 20px;
    right: 20px;
    font-size: 1.25rem;
  }

  .fab i {
    font-size: 18px;
  }

  .filter-container {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
  }

  .filter-btn {
    flex-shrink: 0;
  }

  .cta-buttons {
    flex-direction: column;
    width: 100%;
  }

  .cta-buttons .btn {
    width: 100%;
  }
}