/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
}

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

/* Typography */
h1,
h2,
h3 {
  color: #051424;
  margin-bottom: 0.8rem;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 0;
}

h2 {
  font-size: 1.8rem;
}

h3 {
  font-size: 1.3rem;
  margin-top: 1.5rem;
}

p {
  margin-bottom: 1rem;
}

ul,
ol {
  margin-left: 2rem;
  margin-bottom: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Header */
header {
  background: linear-gradient(135deg, #6e48aa 0%, #9d50bb 100%);
  color: white;
  padding: 2rem 0;
  text-align: center;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 5;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.logo {
  width: 72px;
  height: 72px;
  margin-right: 15px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.tagline {
  font-size: 1.2rem;
  opacity: 0.9;
  margin-bottom: 1.2rem;
}

.header-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.header-nav a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
}

.header-nav a:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
}

/* Add space for results section to overlap header */
.page-wrapper {
  position: relative;
  z-index: 6;
  padding-top: 30px;
}

/* Main Layout */
.page-wrapper {
  display: flex;
  justify-content: space-between;
  max-width: 1600px;
  margin: 0 auto;
  position: relative;
}

main {
  padding: 2rem 0;
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
}

/* Gutter Elements for Amazon Affiliates */
.gutter-ad {
  display: block;
  width: 185px;
  max-width: 185px;
  padding: 1rem 0;
}

.left-gutter {
  margin-left: 15px;
  padding-top: 5rem;
}

.right-gutter {
  margin-right: 15px;
  padding-top: 5rem;
}

/* Affiliate Content Styling */
.affiliate-sidebar {
  position: sticky;
  top: 20px;
  z-index: 2;
  display: block !important;
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
  visibility: visible !important;
}

/* Fix for sticky positioning - ensure parent containers don't clip overflow */
.page-wrapper {
  overflow: visible !important;
}

body {
  overflow-x: hidden;
}

.affiliate-container {
  background-color: white;
  border-radius: 8px;
  padding: 0.75rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(157, 80, 187, 0.1);
  margin-bottom: 1.5rem;
}

.affiliate-content h3 {
  font-size: 0.95rem;
  color: #6e48aa;
  margin-bottom: 1rem;
  text-align: center;
  border-bottom: 1px solid rgba(157, 80, 187, 0.2);
  padding-bottom: 0.5rem;
}

.affiliate-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.affiliate-item {
  transition: transform 0.2s ease;
}

.affiliate-item:hover {
  transform: translateY(-3px);
}

.affiliate-item a {
  text-decoration: none;
  color: #333;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.affiliate-image-container {
  width: 100px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #eee;
}

.affiliate-image-container img {
  max-width: 100%;
  max-height: 100%;
}

.affiliate-title {
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.4;
}

.amazon-disclaimer {
  margin-top: 1rem;
  font-size: 0.7rem;
  color: #666;
  font-style: italic;
  text-align: center;
  border-top: 1px dashed #eee;
  padding-top: 0.5rem;
}

@media (max-width: 1200px) {
  .gutter-ad {
    width: 150px;
  }

  .affiliate-image-container {
    width: 85px;
    height: 85px;
  }

  .affiliate-title {
    font-size: 0.75rem;
  }

  .left-gutter {
    margin-left: 10px;
  }

  .right-gutter {
    margin-right: 10px;
  }
}

@media (max-width: 1024px) {
  .gutter-ad {
    display: none !important;
    /* Force hide on smaller screens */
  }

  /* Show the horizontal affiliate banners in content area instead */
  .affiliate-banner {
    display: block !important;
  }
}

.results-section {
  background: linear-gradient(135deg, #ffffff 0%, #f8f4fc 100%);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 2.5rem;
  margin-bottom: 3rem;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
  display: none;
  border-radius: 12px;
  border: 1px solid rgba(157, 80, 187, 0.2);
  border-top: 5px solid #9d50bb;
}

.results-section.active {
  display: block;
}

.app-container {
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
  padding: 2rem;
  margin-bottom: 3rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.input-section {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  padding: 0.5rem;
}

/* Form Elements */
.form-group {
  margin-bottom: 1.2rem;
}

.names-input-group {
  margin-bottom: 1.5rem;
}

.inline-form-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.inline-form-group label {
  margin-bottom: 0;
  min-width: 60px;
}

.inline-form-group select {
  width: auto;
  flex: 0 0 auto;
}

/* Info tooltip */
.auto-info-tooltip {
  position: relative;
  display: inline-block;
}

.info-icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: #9d50bb;
  color: white;
  font-size: 12px;
  font-style: italic;
  cursor: pointer;
  margin-left: 5px;
}

.tooltip-content {
  visibility: hidden;
  position: absolute;
  width: 250px;
  background-color: #fff;
  color: #333;
  text-align: center;
  border-radius: 4px;
  padding: 10px;
  z-index: 100;
  bottom: 125%;
  left: 50%;
  transform: translateX(-90%);
  opacity: 0;
  transition: opacity 0.3s;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  font-size: 0.9rem;
}

.tooltip-content p {
  margin: 0;
}

.tooltip-content::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 90%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #fff transparent transparent transparent;
}

.auto-info-tooltip:hover .tooltip-content {
  visibility: visible;
  opacity: 1;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #444;
  font-size: 1.05rem;
}

textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  resize: vertical;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s;
  background-color: #fcfcfc;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
  min-height: 180px;
}

textarea:focus {
  border-color: #9d50bb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(157, 80, 187, 0.1);
  background-color: #fff;
}

select {
  padding: 0.6rem 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  background-color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239d50bb' d='M3.5 4.5l2.5 2.5 2.5-2.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

select:focus {
  border-color: #9d50bb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(157, 80, 187, 0.1);
}

select:hover {
  border-color: #9d50bb;
  background-color: #fafafa;
}

.button-container {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

button {
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#assignButton {
  background: linear-gradient(135deg, #9d50bb 0%, #6e48aa 100%);
  color: white;
  flex: 2;
}

#assignButton:hover {
  background: linear-gradient(135deg, #8441a4 0%, #5d3a99 100%);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

#clearButton {
  background-color: #f5f5f5;
  color: #555;
  flex: 1;
  border: 1px solid #eee;
}

#clearButton:hover {
  background-color: #e8e8e8;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

/* Results Section */
.instructions {
  color: #666;
  font-style: italic;
}

.results-section.active {
  position: relative;
  margin-top: -60px;
  /* Overlap with header */
  z-index: 10;
  transform: translateY(0);
  opacity: 1;
  display: block;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  position: relative;
  flex-wrap: wrap;
}

.header-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.results-section h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 0;
  color: #6e48aa;
  position: relative;
}

.focus-button {
  display: flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #2c3e50 0%, #4a275a 100%);
  border-radius: 8px;
}

.focus-button:hover {
  background: linear-gradient(135deg, #34495e 0%, #5d3a70 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.focus-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid white;
  position: relative;
}

.focus-icon::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border: 1px solid white;
  opacity: 0.7;
}

.results-section h2:after {
  content: "";
  display: block;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #9d50bb, transparent);
  margin: 0.7rem auto 0;
}

#randomizeAgainButton {
  display: none;
}

.results-section.active #randomizeAgainButton {
  display: inline-block;
}

.action-button {
  background: linear-gradient(135deg, #9d50bb 0%, #6e48aa 100%);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.action-button:hover {
  background: linear-gradient(135deg, #8441a4 0%, #5d3a99 100%);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

#groupResults {
  margin-top: 1.5rem;
  display: grid;
  gap: 1.5rem;
  justify-content: center;
}

/* Always use 3 columns when possible */
.grid-layout {
  grid-template-columns: repeat(3, 1fr);
}

.group-card {
  background-color: white;
  border-radius: 12px;
  padding: 1.5rem;
  border-left: 6px solid #9d50bb;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  width: 100%;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.names-list {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.group-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-color: rgba(157, 80, 187, 0.15);
}

.group-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: #9d50bb;
  text-align: center;
  border-bottom: 2px solid #f0e6f5;
  padding-bottom: 0.8rem;
  margin-bottom: 0.4rem;
}

.member-count {
  font-size: 0.85rem;
  color: #666;
  font-weight: normal;
  opacity: 0.8;
}

.names-list {
  margin-top: 0.8rem;
}

.name-item {
  padding: 0.5rem 0;
  border-bottom: 1px dashed #eee;
  font-size: 1.1rem;
  text-align: center;
  font-weight: 500;
  color: #333;
  transition: background-color 0.2s;
}

.name-item:hover {
  background-color: #fafafa;
}

.name-item:last-child {
  border-bottom: none;
}

/* Example Groups Styling */
.example-group {
  opacity: 0.85;
  border-left: 6px dashed #9d50bb;
  background-color: #fcfaff;
}

.example-banner {
  text-align: center;
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding: 0.8rem;
  background-color: #f0e6f5;
  border-radius: 8px;
  color: #6e48aa;
  font-style: italic;
  border: 1px dashed #9d50bb;
}

.example-banner p {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
}

/* Ad spaces hidden for now */
/* Affiliate banner content */
.affiliate-banner {
  display: block;
  margin: 2rem 0;
}

/* Set affiliate banners to display:none by default on non-homepage pages */
body:not(.home-page) .affiliate-banner:not(:last-child) {
  display: none;
}

.affiliate-banner .affiliate-container {
  padding: 1.5rem;
}

.affiliate-horizontal {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.affiliate-item-horizontal {
  flex: 1;
  transition: transform 0.2s ease;
}

.affiliate-item-horizontal:hover {
  transform: translateY(-3px);
}

.affiliate-item-horizontal a {
  text-decoration: none;
  color: #333;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

@media (max-width: 768px) {
  .affiliate-horizontal {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }

  .affiliate-item-horizontal {
    width: 100%;
    max-width: 200px;
  }
}

/* Info Section */
.info-section {
  background-color: white;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.info-section h2 {
  color: #6e48aa;
  font-size: 1.6rem;
  margin-bottom: 1rem;
}

.info-section h3 {
  color: #333;
  font-size: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
}

.info-section ul,
.info-section ol {
  margin-left: 1.5rem;
}

.info-section li {
  margin-bottom: 0.6rem;
}

.info-section strong {
  color: #555;
}

/* Tips and Best Practices Section */
.tips-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.tip-card {
  background-color: #f8f4fc;
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid rgba(157, 80, 187, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tip-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.tip-card h3 {
  color: #6e48aa;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  border-bottom: 2px solid rgba(157, 80, 187, 0.2);
  padding-bottom: 0.5rem;
}

.tip-card ul,
.tip-card ol {
  margin-left: 1.2rem;
  font-size: 0.95rem;
}

.testimonial-author {
  font-style: italic;
  text-align: right;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  color: #666;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .tips-container {
    grid-template-columns: 1fr;
  }
}

/* Article Section */
.article-section {
  background-color: #f8f9fa;
}

.article {
  padding: 1rem 0;
}

.article h3 {
  font-size: 1.4rem;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.article h4 {
  font-size: 1.1rem;
  color: #444;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.article-meta {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1rem;
  font-style: italic;
}

.article p {
  margin-bottom: 0.8rem;
  line-height: 1.6;
}

.article-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1), transparent);
  margin: 2rem 0;
}

.read-more-link {
  text-align: right;
  margin-top: 1.5rem;
}

.read-more-link a {
  color: #9d50bb;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
}

.read-more-link a:hover {
  color: #6e48aa;
  text-decoration: underline;
}

/* Footer */
footer {
  background: linear-gradient(135deg, #2c3e50 0%, #4a275a 100%);
  color: white;
  padding: 1.5rem 0;
  text-align: center;
  box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1);
}

.footer-links {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: white;
  text-decoration: underline;
}

.affiliate-disclaimer {
  font-size: 0.8rem;
  margin-top: 1.5rem;
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.4;
}

@media (max-width: 500px) {
  .footer-links {
    flex-direction: column;
    gap: 0.7rem;
  }

  .affiliate-disclaimer {
    font-size: 0.7rem;
  }
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, rgba(110, 72, 170, 0.95) 0%, rgba(157, 80, 187, 0.95) 100%);
  color: white;
  padding: 1rem;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
  display: none;
}

.cookie-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.cookie-content p {
  margin: 0;
  flex: 3;
  min-width: 200px;
  font-size: 0.9rem;
}

.cookie-buttons {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  justify-content: flex-end;
}

.cookie-buttons button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 600;
}

#cookie-accept {
  background-color: white;
  color: #9d50bb;
}

#cookie-accept:hover {
  background-color: #f8f8f8;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

#cookie-decline {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

#cookie-decline:hover {
  background-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Media Queries */
@media (max-width: 1024px) {

  /* For tablet, show 2 columns */
  .grid-layout {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }

  /* Single column grid for mobile */
  .grid-layout {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 1.8rem;
  }

  .logo {
    width: 54px;
    height: 54px;
    margin-right: 10px;
  }

  .button-container {
    flex-direction: column;
  }

  #assignButton,
  #clearButton {
    width: 100%;
  }

  .cookie-content {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-buttons {
    justify-content: stretch;
  }

  /* Make the results overlap less on mobile */
  .results-section.active {
    margin-top: -40px;
  }

  .name-item {
    font-size: 1.2rem;
    /* Slightly smaller on mobile */
  }

  /* Adjust header and button on small screens */
  .results-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .results-section h2 {
    font-size: 1.6rem;
  }

  #randomizeAgainButton {
    font-size: 0.9rem;
    padding: 0.5rem 1.2rem;
  }

  /* Header navigation on small screens */
  .header-nav {
    gap: 0.8rem;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .header-nav a {
    font-size: 0.9rem;
    padding: 0.25rem 0.4rem;
  }
}

@media (max-width: 500px) {
  .header-nav {
    gap: 0.5rem;
  }

  .header-nav a {
    font-size: 0.85rem;
    padding: 0.2rem 0.3rem;
  }
}

/* Focus Mode Modal */
.focus-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  overflow: auto;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.focus-modal.active {
  display: block;
  opacity: 1;
}

.focus-close-button {
  position: fixed;
  padding: 0;
  top: 12px;
  right: 20px;
  background: rgba(157, 80, 187, 0.6);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  font-size: 2rem;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1010;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  line-height: 0;
}

.focus-close-button:hover {
  background: rgba(157, 80, 187, 0.8);
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.focus-groups-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.2rem;
  width: 96%;
  max-width: 100%;
  height: 90vh;
  margin: 3% auto;
  padding: 0.5rem;
  box-sizing: border-box;
  overflow: hidden;
  /* Prevent scrolling */
}

@media (min-width: 1200px) {
  .focus-groups-container {
    /* For larger screens, limit to 4 columns maximum */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    max-width: 1600px;
  }
}

.focus-group-card {
  background-color: white;
  border-radius: 12px;
  padding: 1.2rem;
  border-left: 8px solid #9d50bb;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.4s ease-out;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(157, 80, 187, 0.1);
  min-width: 0;
  /* Prevent overflow in grid */
}

.focus-group-title {
  font-weight: 700;
  color: #9d50bb;
  text-align: center;
  border-bottom: 3px solid #f0e6f5;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  /* Font size will be dynamically set by JavaScript */
}

.focus-group-title .member-count {
  color: #666;
  font-weight: normal;
  opacity: 0.8;
  /* Font size will be dynamically set by JavaScript */
}

.focus-name-item {
  padding: 0.2rem 0;
  border-bottom: 1px dashed #eee;
  text-align: center;
  font-weight: 500;
  color: #333;
  transition: background-color 0.2s;
  /* Font size will be dynamically set by JavaScript */
}

.focus-name-item:hover {
  background-color: rgba(157, 80, 187, 0.05);
}

.focus-names-list {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  min-width: 0;
  /* Prevent overflow in grid */
  overflow: hidden;
}

.focus-name-item:last-child {
  border-bottom: none;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shuffleOut {
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
}

.group-card {
  animation: fadeIn 0.3s ease-out;
}

.group-card.shuffling {
  animation: shuffleOut 0.3s ease-out forwards;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.focus-modal.active .focus-modal-content {
  animation: modalFadeIn 0.4s ease-out;
}