/* BBclubs Groups Styling - Extracted from inline styles */

.post-author-avatar img.avatar {
    width: 32px !important;
    height: 32px !important;
}

/* Modern Grid & Masonry Layout */
.bbclubs-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.bbclubs-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 30px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 15px;
  color: white;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.bbclubs-header h1 {
  margin: 0 0 10px 0;
  font-size: 2.5rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.bbclubs-header p {
  margin: 0;
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Container spans sidebar width */
.create-group-button-container {
  width: 100%;              /* take full sidebar width */
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e9ecef;
}

/* Button fills container */
.create-group-btn {
  display: block;           /* block ensures full width */
  width: 100%;              /* fill parent */
  padding: 12px;            /* equal padding */
  background: #28a745;
  color: #fff;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  border: 1px solid #28a745;
  box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
  box-sizing: border-box;   /* ensures padding doesn't overflow */
}

.create-group-btn:hover {
  background: #218838;
  border-color: #1e7e34;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

/* Main Layout with Sidebar - Matching /club/{slug} style */
.groups-main-layout {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  transition: all 0.3s ease;
  min-height: calc(100vh - 120px);
  position: relative;
}

/* Groups Sidebar - Matching /club/{slug} style */
.groups-sidebar {
  width: 18%;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  border: 1px solid #e9ecef;
  height: fit-content;
  transition: all 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
  position: sticky;
  top: 20px;
  align-self: flex-start;
  max-height: calc(100vh - 40px);
}

/* Custom scrollbar for sidebar - matching /club/{slug} */
.groups-sidebar::-webkit-scrollbar {
  width: 6px;
}

.groups-sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.groups-sidebar::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.groups-sidebar::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.sidebar-header {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e9ecef;
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin: 0 0 5px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-subtitle {
  font-size: 12px;
  color: #666;
  margin: 0;
  line-height: 1.4;
}

.groups-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.group-list-item {
  margin-bottom: 8px;
}

.group-list-link {
  display: block;
  padding: 8px 12px;
  border-radius: 4px;
  text-decoration: none;
  color: #333;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  font-size: 12px;
  line-height: 1.4;
}

.group-list-link:hover {
  background: #e9ecef;
  color: #333;
  text-decoration: none;
  border-color: #dee2e6;
}

.group-list-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.group-list-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #6c757d;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 10px;
  flex-shrink: 0;
}

.group-list-name {
  font-size: 12px;
  font-weight: 500;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.group-list-meta {
  font-size: 10px;
  color: #6c757d;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.group-list-members {
  display: flex;
  align-items: center;
  gap: 2px;
}

.group-list-type {
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  background: #e9ecef;
  color: #6c757d;
}

.group-list-type.public {
  background: #d4edda;
  color: #155724;
}

.group-list-type.private {
  background: #fff3cd;
  color: #856404;
}

/* Groups Content Area */
.groups-content {
  width: 82%;
  flex: 1;
  transition: all 0.3s ease;
  overflow: visible;
  position: relative;
}

/* First Posts Container */
.first-posts-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 30px;
}

/* First Post Card */
.first-post-card {
  background: white;
  border-radius: 12px;
  border: 1px solid #e9ecef;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  overflow: hidden;
}

.first-post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.first-post-card.no-posts {
  opacity: 0.8;
}

/* Post Header */
.post-header {
  padding: 20px 20px 15px 20px;
  border-bottom: 1px solid #f8f9fa;
  background: #f8f9fa;
}

.post-group-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.post-group-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 18px;
  flex-shrink: 0;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.post-group-details {
  flex: 1;
  min-width: 0;
}

.post-group-name {
  margin: 0 0 5px 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.post-group-name a {
  color: #333;
  text-decoration: none;
}

.post-group-name a:hover {
  color: #667eea;
  text-decoration: none;
}

.post-group-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: #666;
}

.post-group-type {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.post-group-type.public {
  background: #d4edda;
  color: #155724;
}

.post-group-type.private {
  background: #fff3cd;
  color: #856404;
}

/* Post Content */
.post-content {
  padding: 20px;
}

.post-title {
  margin-bottom: 15px;
}

.post-title a {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  text-decoration: none;
  line-height: 1.4;
}

.post-title a:hover {
  color: #667eea;
  text-decoration: none;
}

.post-preview {
  color: #666;
  line-height: 1.6;
  margin-bottom: 20px;
  font-size: 0.95rem;
}

/* Post Footer */
.post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid #f8f9fa;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.post-author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.post-author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-author-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
}

.post-time {
  font-size: 0.8rem;
  color: #666;
}

.post-actions {
  display: flex;
  gap: 10px;
}

.btn-reply {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #f8f9fa;
  color: #666;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid #dee2e6;
  transition: all 0.3s ease;
}

.btn-reply:hover {
  background: #e9ecef;
  color: #333;
  text-decoration: none;
  border-color: #adb5bd;
}

.btn-reply svg {
  flex-shrink: 0;
}

.btn-view-group {
  padding: 8px 16px;
  background: #f8f9fa;
  color: #333;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid #dee2e6;
  transition: all 0.3s ease;
}

.btn-view-group:hover {
  background: #e9ecef;
  color: #333;
  text-decoration: none;
}

.no-posts-message {
  text-align: center;
  padding: 20px;
  color: #666;
}

.no-posts-message p {
  margin: 0 0 15px 0;
  font-style: italic;
}

.group-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  border: 1px solid #e9ecef;
  position: relative;
}

.group-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.group-cover {
  height: 180px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.group-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.group-card:hover .group-cover img {
  transform: scale(1.05);
}

.group-cover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.group-card:hover .group-cover::after {
  opacity: 1;
}

.group-type-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
}

.group-type-badge.public {
  background: rgba(40, 167, 69, 0.9);
  color: white;
  backdrop-filter: blur(10px);
}

.group-type-badge.private {
  background: rgba(255, 193, 7, 0.9);
  color: #212529;
  backdrop-filter: blur(10px);
}

.group-type-badge.hidden {
  background: rgba(220, 53, 69, 0.9);
  color: white;
  backdrop-filter: blur(10px);
}

.group-content {
  padding: 25px;
}

.group-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.group-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  margin-right: 15px;
  border: 3px solid #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.group-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.group-title {
  flex: 1;
  min-width: 0;
}

.group-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #333;
  margin: 0 0 5px 0;
  text-decoration: none;
  display: block;
  line-height: 1.3;
}

.group-name:hover {
  color: #667eea;
  text-decoration: none;
}

.group-creator {
  color: #666;
  font-size: 0.9rem;
  margin: 0;
}

.group-description {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 15px 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.group-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
}

.stat-item {
  text-align: center;
  flex: 1;
}

.stat-number {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 2px;
}

.stat-label {
  font-size: 0.8rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.group-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-modern {
  flex: 1;
  padding: 10px 15px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn-modern:hover::before {
  left: 100%;
}

.btn-primary {
  background: #667eea;
  color: white;
  border: 1px solid #667eea;
}

.btn-primary:hover {
  background: #5a6fd8;
  border-color: #4e63d1;
  color: white;
  text-decoration: none;
}

.btn-success {
  background: #28a745;
  color: white;
  border: 1px solid #28a745;
}

.btn-success:hover {
  background: #218838;
  border-color: #1e7e34;
  color: white;
  text-decoration: none;
}

.no-groups {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
  border: 1px solid #e9ecef;
}

.no-groups h3 {
  color: #333;
  margin-bottom: 15px;
  font-size: 1.5rem;
  font-weight: 600;
}

.no-groups p {
  color: #666;
  margin-bottom: 25px;
  font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .bbclubs-container {
    padding: 15px;
  }
  
  .bbclubs-header h1 {
    font-size: 2rem;
  }
  
  .groups-main-layout {
    flex-direction: column;
    min-height: auto;
  }
  
  .groups-sidebar {
    width: 100%;
    height: auto;
    position: static;
    max-height: none;
    top: auto;
    align-self: auto;
  }
  
  .groups-content {
    width: 100%;
    overflow: visible;
  }
  
  .first-posts-container {
    gap: 15px;
  }
  
  .first-post-card {
    margin: 0 10px;
  }
  
  .post-header {
    padding: 15px;
  }
  
  .post-content {
    padding: 15px;
  }
  
  .post-group-info {
    gap: 12px;
  }
  
  .post-group-avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  
  .post-group-name {
    font-size: 1rem;
  }
  
  .post-title a {
    font-size: 1.1rem;
  }
  
  .post-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .group-actions {
    flex-direction: column;
  }
  
  .btn-modern {
    margin-bottom: 10px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .groups-masonry {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1025px) {
  .groups-masonry {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Loading Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.group-card {
  animation: fadeInUp 0.6s ease forwards;
}

.group-card:nth-child(1) { animation-delay: 0.1s; }
.group-card:nth-child(2) { animation-delay: 0.2s; }
.group-card:nth-child(3) { animation-delay: 0.3s; }
.group-card:nth-child(4) { animation-delay: 0.4s; }
.group-card:nth-child(5) { animation-delay: 0.5s; }
.group-card:nth-child(6) { animation-delay: 0.6s; }

/* Search and Filter Styles */
.search-filter-section {
 
}

.search-filter-form {
  width: 100%;
}

.search-filter-row {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.search-input-group {
  display: flex;
  flex: 1;
  min-width: 250px;
  position: relative;
}

.search-input {
  flex: 1;
  padding: 12px 50px 12px 15px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
  background: #f8f9fa;
}

.search-input:focus {
  outline: none;
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-btn {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
 
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #080808;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-btn:hover {
 
}

.filter-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-select {
  padding: 10px 15px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
}

.filter-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.active-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
  border: 1px solid #e9ecef;
}

.active-filters-label {
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #667eea;
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid #667eea;
}

.remove-filter {
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-size: 16px;
  line-height: 1;
  margin-left: 5px;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.remove-filter:hover {
  opacity: 1;
  color: white;
  text-decoration: none;
}

.clear-all-filters {
  color: #dc3545;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border: 1px solid #dc3545;
  border-radius: 20px;
  transition: all 0.3s ease;
}

.clear-all-filters:hover {
  background: #dc3545;
  color: white;
  text-decoration: none;
}

/* Responsive adjustments for search/filter */
@media (max-width: 768px) {
  .search-filter-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-input-group {
    min-width: auto;
  }
  
  .filter-group {
    justify-content: center;
  }
  
  .filter-select {
    flex: 1;
    min-width: 100px;
  }
  
  .active-filters {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* wrapper that contains left sidebar, content, right sidebar */
.club-layout {
  display: flex;
  align-items: flex-start;
  flex-wrap: nowrap;          /* important */
  gap: 16px;
}

.club-sidebar-left { flex: 0 0 260px; max-width: 260px; }
.club-sidebar-right { flex: 0 0 300px; max-width: 300px; }

/* Let the middle column shrink instead of pushing sidebars down */
.club-content {
  flex: 1 1 auto;
  min-width: 0;               /* CRITICAL to prevent overflow pushing columns */
  overflow: hidden;           /* belt-and-suspenders */
}

/* Add missing inline button style so it aligns nicely in the row */
.create-group-button-inline {
  margin-left: auto; /* pushes it to the end of the row */
}

.create-group-button-inline .create-group-btn {
  white-space: nowrap;
}

/* Optional: if you really want the whole row in one line on wide screens */
@media (min-width: 992px) {
  .search-filter-row {
    flex-wrap: nowrap;
  }
}

.groups-main-layout {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  min-height: calc(100vh - 120px);
  position: relative;
}

/* Shared sidebar styles stay the same... */
.groups-sidebar {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  border: 1px solid #e9ecef;
  height: fit-content;
  overflow-y: auto;
  position: sticky;
  top: 20px;
  align-self: flex-start;
  max-height: calc(100vh - 40px);
}

/* Size each sidebar explicitly */
.groups-sidebar-left  { flex: 0 0 17%; max-width: 18%; }
.groups-sidebar-right { flex: 0 0 17%; max-width: 18%; }

/* Let content take remaining space; drop fixed width */
.groups-content { flex: 1 1 auto; min-width: 0; overflow: visible; }

/* Mobile: stack columns */
@media (max-width: 992px) {
  .groups-main-layout { flex-direction: column; }
  .groups-sidebar-left,
  .groups-sidebar-right,
  .groups-content { flex: 1 1 auto; max-width: 100%; position: static; max-height: none; }
}

.create-group-button-inline {
  margin-left: auto;       /* push to the far right of the row */
  flex: 0 0 auto;          /* don't stretch */
}

.create-group-button-inline .create-group-btn {
  width: auto;             /* override the block/full-width version */
  padding: 10px 14px;
}
