/* Smart Category Grid Frontend Styles - QTA Design */

.scg-dynamic-grid {
  display: grid;
  grid-template-columns: repeat(var(--scg-cols, 3), 1fr);
  gap: 20px;
  align-items: start;
  margin: 2rem 0;
}

/* Allow inner items to be grid children */
.scg-grid-items {
  display: contents;
}

.scg-card {
  background: #111;
  color: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

.scg-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.scg-card-image {
  height: 200px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.scg-card-meta {
  padding: 12px;
}

.scg-card-meta h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
}

.scg-card-action {
  padding: 8px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  text-align: center;
}

.scg-more-info {
  background: #2a7;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font-size: 0.9rem;
  transition: background-color 0.3s ease;
}

.scg-more-info:hover {
  background: #1a5;
  color: #fff;
}

/* Text box (matching QTA design) */
.scg-textbox {
  grid-column: span var(--scg-textbox-span, 3);
  /* background: #123d27; */
  /* color: #dfffa3; */
  /* padding: 22px; */
  /* border-radius: 10px; */
}

.scg-textbox-title {
  margin: 0 0 8px;
  font-size: 24px;
  /* color: #bffb4b; */
}

.scg-textbox-subtitle {
  margin: 0 0 12px;
  /* color: #e8f8d0; */
}

.scg-textbox-desc {
  line-height: 1.6;
  margin: 0;
  /* color: #dfffa3; */
}

.scg-textbox-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 18px;
  background: #2c5a3b;
  color: #fff;
  border-radius: 22px;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.scg-textbox-btn:hover {
  background: #3d6b4c;
  color: #fff;
}

/* Theme Variations */
.scg-theme-blue .scg-card {
  background: #1e3a8a;
}

.scg-theme-blue .scg-more-info {
  background: #3b82f6;
}

.scg-theme-blue .scg-textbox {
  background: #1e293b;
  color: #e2e8f0;
}

.scg-theme-blue .scg-textbox-title {
  color: #60a5fa;
}

.scg-theme-red .scg-card {
  background: #7f1d1d;
}

.scg-theme-red .scg-more-info {
  background: #dc2626;
}

.scg-theme-red .scg-textbox {
  background: #374151;
  color: #f3f4f6;
}

.scg-theme-red .scg-textbox-title {
  color: #f87171;
}

/* Error messages */
.scg-error,
.scg-no-items {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  color: #856404;
  padding: 1rem;
  border-radius: 5px;
  margin: 1rem 0;
  text-align: center;
}

.scg-error {
  background: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

/* Responsive (matching QTA) */
@media (max-width: 900px) {
  .scg-dynamic-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .scg-dynamic-grid {
    grid-template-columns: 1fr;
  }

  .scg-textbox {
    grid-column: span 1 !important;
  }

  .scg-card-image {
    height: 150px;
  }

  .scg-textbox {
    padding: 16px;
  }

  .scg-textbox-title {
    font-size: 20px;
  }
}

.scg-grid-container {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.scg-grid-item {
  grid-column: span 4;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.scg-grid-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border-color: #007cba;
}

.scg-grid-item a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.scg-item-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.scg-grid-item:hover .scg-item-image {
  transform: scale(1.05);
}

.scg-item-content {
  padding: 1.5rem;
  text-align: center;
}

.scg-item-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: #2c3e50;
  line-height: 1.4;
}

.scg-item-description {
  font-size: 0.95rem;
  color: #666666;
  line-height: 1.5;
  margin: 0;
}

/* Text Block Styles */
.scg-text-block {
  grid-column: span 8;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 8px;
  text-align: left;
}

.scg-text-block.full-width {
  grid-column: span 12;
  text-align: center;
  padding: 3rem 2rem;
}

.scg-text-heading {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.scg-text-paragraph {
  font-size: 1.1rem;
  line-height: 1.6;
  margin: 0;
  opacity: 0.95;
}

.scg-text-button {
  display: inline-block;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  align-self: flex-start;
}

.scg-text-block.full-width .scg-text-button {
  align-self: center;
}

.scg-text-button:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
  transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 992px) {
  .scg-grid-container {
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
  }

  .scg-grid-item {
    grid-column: span 3;
  }

  .scg-text-block {
    grid-column: span 6;
    padding: 1.5rem;
  }

  .scg-text-block.full-width {
    grid-column: span 6;
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 768px) {
  .scg-grid-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .scg-grid-item,
  .scg-text-block,
  .scg-text-block.full-width {
    grid-column: span 2;
  }

  .scg-item-image {
    height: 150px;
  }

  .scg-item-content {
    padding: 1rem;
  }

  .scg-item-title {
    font-size: 1.1rem;
  }

  .scg-text-heading {
    font-size: 1.5rem;
  }

  .scg-text-paragraph {
    font-size: 1rem;
  }

  .scg-text-block {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .scg-grid-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .scg-grid-item,
  .scg-text-block,
  .scg-text-block.full-width {
    grid-column: span 1;
  }

  .scg-item-image {
    height: 180px;
  }
}