/**
 * Partnership Ecosystem Styles
 * CSS styles for the Serenity Star Partnership Ecosystem page
 *
 * @author Serenity Star Design Team
 * @version 1.0.2
 */

/* Base reset and typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* For screen reader only elements - visually hidden but accessible */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

body {
  background-color: #f7f9fc;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  padding: 20px 0;
  margin-bottom: 40px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

/* Logo styling */
.logo {
  max-width: 360px; 
  max-height: 120px; 
  margin-bottom: 20px;
}

h1 {
  color: #050a2b;
  font-size: 32px;
  margin-bottom: 10px;
}

.subtitle {
  color: #7f8c8d;
  font-size: 18px;
  margin-bottom: 30px;
}

/* Search bar and clear button */
.search-container {
  position: relative;
  margin: 20px auto;
  width: 100%;
  max-width: 500px;
}

.search-input {
  width: 100%;
  padding: 10px 40px 10px 15px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 16px;
  outline: none;
  transition: all 0.3s ease;
}

#clear-search {
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  color: #4862ff;
}

.search-input:focus {
  border-color: #4862ff;
  box-shadow: 0 0 8px rgba(72,98,255,0.3);
}

/* Result count display */
.result-count {
  text-align: center;
  margin-bottom: 20px;
  font-size: 16px;
  color: #2c3e50;
}

/* Filters */
.filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.filter-btn {
  padding: 8px 16px;
  background-color: #ecf0f1;
  border: none;
  border-radius: 20px;
  color: #2c3e50;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.filter-btn:hover {
  background-color: #d5dade;
}

.filter-btn.active {
  background-color: #4862ff;
  color: #fff;
}

/* Partners grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  width: 100%;
}

/* Loading spinner animation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.fa-spin {
  animation: spin 1s linear infinite;
}

/* Partner card */
.partner-card {
  position: relative;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s ease;
  opacity: 1;
  height: 100%;
}

/* Apply cursor pointer and hover effects only to clickable cards */
.partner-card.clickable {
  cursor: pointer;
}

.partner-card.clickable:hover {
  box-shadow: 0 8px 20px rgba(72,98,255,0.15);
  transform: translateY(-5px);
}

.partner-card.fade {
  opacity: 0;
}

.partner-logo-container {
  padding: 60px 20px 20px 20px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #f5f5f5;
}

.partner-logo {
  max-width: 80%;
  max-height: 80px;
  object-fit: contain;
}

/* SVG specific styling for partner logos */
.partner-logo[src$=".svg"] {
  width: 80%;
  height: 80px;
}

/* Category pills in top-right */
.card-categories {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  z-index: 10;
}

/* Action buttons in top-left */
.card-actions {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 4px;
  z-index: 20; /* Ensure buttons are always clickable */
}

/* Category pill style */
.pill-category {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  background-color: #c0c7d4;
  color: #2c3e50;
  border: 1px solid #a3acb8;
  white-space: nowrap;
}

/* Partner info */
.partner-info {
  padding: 15px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.partner-name {
  font-size: 20px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 8px;
}

.partner-description {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  color: #5a6b7b;
  margin-bottom: 12px;
}

/* Tag pill style */
.pill-tag {
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  background-color: #f1f4fa;
  color: #6b778c;
  white-space: nowrap;
  border: 1px solid #d3dae6;
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

/* Action links with icons */
.action-links {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #a3acb8;
  border-radius: 4px;
  background-color: #f7f9fc;
  color: #2c3e50;
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease;
  z-index: 20;
}

.icon-btn:hover {
  background-color: #4862ff;
  color: #f7f9fc;
}

/* Loading indicator */
.loading-indicator {
  text-align: center;
  padding: 40px;
  font-size: 16px;
  color: #4862ff;
}

/* No-results message */
.no-results {
  text-align: center;
  padding: 40px 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  margin: 20px 0;
  display: none;
}

.no-results h3 {
  font-size: 22px;
  color: #2c3e50;
  margin-bottom: 15px;
}

.no-results p {
  color: #7f8c8d;
  margin-bottom: 20px;
  max-width: 600px;
  margin: 0 auto 20px;
}

.no-results .cta-button {
  display: inline-block;
  background-color: #4862ff;
  color: #fff;
  padding: 12px 30px;
  border-radius: 5px;
  border: none;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.no-results .cta-button:hover {
  background-color: #3651e8;
  transform: translateY(-2px);
}

/* Error message styling */
.error-message {
  text-align: center;
  padding: 40px 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  margin: 20px 0;
}

.error-message p {
  color: #e74c3c;
  font-size: 18px;
  margin-bottom: 20px;
}

/* Modal styles - Enhanced */
.modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 30px;
  border-radius: 12px;
  max-width: 700px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  animation: modalFadeIn 0.3s ease;
}

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

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  border: none;
  font-size: 22px;
  color: #4862ff;
  cursor: pointer;
  transition: transform 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-close:hover {
  transform: rotate(90deg);
  background-color: #f1f4fa;
}

/* Modal content styling */
.modal-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.modal-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eaeef2;
}

.modal-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-right: 20px;
}

/* Special handling for SVG logo in modal */
.modal-logo[src$=".svg"] {
  width: 80px;
  height: auto;
}

.modal-title {
  font-size: 24px;
  color: #2c3e50;
  font-weight: 700;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.modal-description {
  margin-bottom: 20px;
  line-height: 1.7;
  color: #5a6b7b;
}

.modal-body {
  color: #5a6b7b;
}

.modal-body h3 {
  font-size: 22px;
  color: #2c3e50;
  margin: 20px 0 15px;
}

.modal-body p {
  margin-bottom: 15px;
  line-height: 1.7;
}

.modal-body strong, .modal-body b {
  color: #4862ff;
}

.modal-body ul {
  list-style-type: none;
  margin: 15px 0;
  padding-left: 0;
}

.modal-body ul li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
}

.modal-body ul li:before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  background-color: #4862ff;
  border-radius: 50%;
}

.modal-footer {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #eaeef2;
  display: flex;
  justify-content: flex-end;
  gap: 15px;
}

.modal-btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.modal-btn-primary {
  background-color: #4862ff;
  color: #fff;
  border: none;
}

.modal-btn-primary:hover {
  background-color: #3651e8;
  transform: translateY(-2px);
}

.modal-btn-secondary {
  background-color: transparent;
  color: #4862ff;
  border: 1px solid #4862ff;
}

.modal-btn-secondary:hover {
  background-color: #f1f4fa;
  transform: translateY(-2px);
}

/* Responsive design */
@media screen and (max-width: 992px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
  
  .modal-content {
    max-width: 90%;
    margin: 10% auto;
  }
}

@media screen and (max-width: 768px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
  
  .modal-header {
    flex-direction: column;
    text-align: center;
  }
  
  .modal-logo {
    margin-right: 0;
    margin-bottom: 15px;
  }
  
  .filter-btn {
    font-size: 14px;
    padding: 6px 12px;
  }
}

@media screen and (max-width: 576px) {
  .grid {
    grid-template-columns: 1fr;
  }
  
  .modal-content {
    padding: 20px;
    margin: 15% auto;
  }
  
  h1 {
    font-size: 26px;
  }
  
  .subtitle {
    font-size: 16px;
  }
}

/* Debug info styling */
.debug-info {
  margin-top: 10px;
  padding: 10px;
  background-color: #f9f9f9;
  border-radius: 4px;
  border-left: 3px solid #4862ff;
  font-family: monospace;
  font-size: 12px;
  color: #333;
  text-align: left;
  max-height: 200px;
  overflow-y: auto;
}

.debug-info p {
  margin: 5px 0;
  line-height: 1.4;
}

.debug-info .error {
  color: #e74c3c;
}

.debug-info .success {
  color: #2ecc71;
}

.debug-info .info {
  color: #3498db;
}