/**
 * ChancenBase Styles
 * 
 * @package Chancenbuddy_ChancenBase
 * @since 1.0.0
 */

/* Layout */
.chancenbase-layout {
  display: flex;
  gap: 2rem;
  min-height: 80vh;
  margin: 2rem 0;
}

/* Sidebar */
.chancenbase-sidebar {
  width: 280px;
  background: #fff;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 100px;
  height: fit-content;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.chancenbase-sidebar h3 {
  font-family: 'Rubik', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-group {
  margin-bottom: 1.5rem;
}

.filter-group label {
  display: block;
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 0.5rem;
}

.filter-group select,
.filter-group input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid rgba(51, 51, 51, 0.3);
  border-radius: 8px;
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  transition: all 0.3s ease;
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: #00A3E0;
  box-shadow: 0 0 0 3px rgba(0, 163, 224, 0.1);
}

.btn-reset-filters {
  width: 100%;
  padding: 0.75rem;
  background: #fff;
  border: 2px solid #00A3E0;
  color: #00A3E0;
  border-radius: 8px;
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-reset-filters:hover {
  background: #00A3E0;
  color: #fff;
}

/* Content */
.chancenbase-content {
  flex: 1;
}

.chancenbase-header {
  margin-bottom: 2rem;
}

.chancenbase-header h1 {
  font-family: 'Rubik', sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: #333;
  margin-bottom: 0.5rem;
}

.results-count {
  font-family: 'Rubik', sans-serif;
  font-size: 16px;
  color: #666;
}

/* Search Bar */
.search-bar {
  margin-bottom: 2rem;
  position: relative;
}

.search-bar input {
  width: 100%;
  padding: 1rem 3rem 1rem 1rem;
  border: 2px solid rgba(51, 51, 51, 0.2);
  border-radius: 50px;
  font-family: 'Rubik', sans-serif;
  font-size: 16px;
  transition: all 0.3s ease;
}

.search-bar input:focus {
  outline: none;
  border-color: #00A3E0;
  box-shadow: 0 0 0 3px rgba(0, 163, 224, 0.1);
}

.search-bar button {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: #00A3E0;
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.search-bar button:hover {
  transform: translateY(-50%) scale(1.1);
}

/* Offers Grid */
.offers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.offer-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.offer-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.offer-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.offer-logo {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  background: #F5F5F5;
  border-radius: 8px;
}

.offer-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.offer-title-wrap {
  flex: 1;
}

.offer-title {
  font-family: 'Rubik', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.offer-organization {
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  color: #666;
}

.offer-description {
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  color: #333;
  line-height: 1.6;
  margin-bottom: 1rem;
  flex: 1;
}

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

.tag {
  background: rgba(0, 163, 224, 0.15);
  color: #00A3E0;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-family: 'Rubik', sans-serif;
  font-size: 12px;
  font-weight: 500;
}

.offer-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-apply {
  flex: 1;
  padding: 0.75rem;
  background: #00A3E0;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-apply:hover {
  background: #0088b8;
}

.btn-details {
  padding: 0.75rem 1rem;
  background: #fff;
  color: #00A3E0;
  border: 2px solid #00A3E0;
  border-radius: 8px;
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-details:hover {
  background: #00A3E0;
  color: #fff;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 2rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  animation: modalSlideIn 0.3s ease;
}

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

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #F5F5F5;
}

.modal-logo {
  text-align: center;
  font-size: 64px;
  margin-bottom: 1rem;
}

.modal-logo img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 12px;
}

.modal-title {
  font-family: 'Rubik', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #333;
  text-align: center;
  margin-bottom: 0.5rem;
}

.modal-organization {
  font-family: 'Rubik', sans-serif;
  font-size: 16px;
  color: #666;
  text-align: center;
  margin-bottom: 1.5rem;
}

.modal-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2rem;
}

.modal-section {
  margin-bottom: 2rem;
}

.modal-section h3 {
  font-family: 'Rubik', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin-bottom: 1rem;
}

.modal-section p,
.modal-section div {
  font-family: 'Rubik', sans-serif;
  font-size: 16px;
  color: #333;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 1rem;
}

/* Loading */
.loading-spinner {
  border: 3px solid #F5F5F5;
  border-top: 3px solid #00A3E0;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 3rem auto;
}

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

.no-results {
  text-align: center;
  padding: 3rem;
  color: #666;
}

.no-results-emoji {
  font-size: 48px;
  margin-bottom: 1rem;
}

/* Load More */
.load-more-container {
  text-align: center;
  margin-top: 2rem;
}

.btn-load-more {
  padding: 1rem 2rem;
  background: #00A3E0;
  color: #fff;
  border: none;
  border-radius: 50px;
  font-family: 'Rubik', sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-load-more:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 163, 224, 0.3);
}

/* Responsive */
@media (max-width: 1024px) {
  .chancenbase-layout {
    flex-direction: column;
  }
  
  .chancenbase-sidebar {
    width: 100%;
    position: relative;
    top: 0;
    max-height: none;
  }
  
  .offers-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .chancenbase-header h1 {
    font-size: 28px;
  }
  
  .offer-actions {
    flex-direction: column;
  }
  
  .modal-content {
    padding: 1.5rem;
  }
  
  .modal-title {
    font-size: 24px;
  }
}