/* Modern Card-Based Interface for LUX PBN */

:root {
  --card-width: 280px;
  --card-height: 220px;
  --card-expanded-height: 400px;
  --card-border-radius: var(--radius-lg);
  --card-transition: 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  --card-shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.3);
  --card-shadow-active: 0 20px 50px rgba(0, 0, 0, 0.4);
  --circle-radius: 250px; /* Radius of the circular layout */
  
  /* Card colors */
  --domain-card-color: rgb(var(--entity-domain-rgb));
  --domain-card-gradient: linear-gradient(135deg, rgb(var(--entity-domain-rgb)), rgba(var(--entity-domain-rgb), 0.7));
  --client-card-color: rgb(var(--entity-client-rgb));
  --client-card-gradient: linear-gradient(135deg, rgb(var(--entity-client-rgb)), rgba(var(--entity-client-rgb), 0.7));
  --keyword-card-color: rgb(var(--entity-keyword-rgb));
  --keyword-card-gradient: linear-gradient(135deg, rgb(var(--entity-keyword-rgb)), rgba(var(--entity-keyword-rgb), 0.7));
  --deployment-card-color: rgb(var(--brand-blue-rgb));
  --deployment-card-gradient: linear-gradient(135deg, rgb(var(--brand-blue-rgb)), rgba(var(--brand-blue-rgb), 0.7));
  --content-card-color: rgb(var(--brand-secondary-rgb));
  --content-card-gradient: linear-gradient(135deg, rgb(var(--brand-secondary-rgb)), rgba(var(--brand-secondary-rgb), 0.7));
}

/* Feature cards container - Grid Layout */
.feature-cards-container {
  position: relative;
  width: 100%; /* Full width of parent */
  height: 700px;
  margin: 0 auto; /* Center the container */
  perspective: 1000px;
  display: grid;
  grid-template-columns: repeat(7, 1fr); /* 7 equal columns */
  grid-template-rows: repeat(3, auto); /* 3 rows */
  gap: 20px;
  padding: 20px 0;
  max-width: 1333px; /* Match the container max-width */
}

/* Dashboard card body padding adjustment */
.dashboard-card-body {
  padding: 0 !important; /* Remove padding from dashboard card body */
}

/* Feature card */
.feature-card {
  width: var(--card-width);
  height: var(--card-height);
  border-radius: var(--card-border-radius);
  background-color: rgba(var(--dark-850), 0.9);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: all var(--card-transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transform: translateZ(0);
  will-change: transform, height, box-shadow;
  justify-self: center; /* Center in grid cell */
}

/* Card positions in grid layout - 3 rows, 7 columns each */
/* Row 1: Domain Management in column 4 (middle) */
.domain-card {
  grid-row: 1;
  grid-column: 3; /* Move to column 3 to shift left */
  color: var(--domain-card-color);
  z-index: 5;
  justify-self: end; /* Align to the right of its cell */
}

/* Row 2: Content Automation in column 2, Client Tracking in column 6 */
.content-card {
  grid-row: 2;
  grid-column: 2;
  color: var(--content-card-color);
  z-index: 4;
  justify-self: center;
}

.client-card {
  grid-row: 2;
  grid-column: 4; /* Move from 5 to 4 to bring it left */
  color: var(--client-card-color);
  z-index: 4;
  justify-self: end; /* Align to the right of its cell */
}

/* Row 3: Deployment on left, Link Building on right, meeting in the middle */
.deployment-card {
  grid-row: 3;
  grid-column: 3; /* Position in column 3 */
  color: var(--deployment-card-color);
  z-index: 3;
  justify-self: end; /* Align to the right of its cell */
  margin-right: calc(var(--card-width) / 4); /* Move left to meet in the middle */
}

.keyword-card {
  grid-row: 3;
  grid-column: 4; /* Position in column 4 */
  color: var(--keyword-card-color);
  z-index: 3;
  justify-self: start; /* Align to the left of its cell */
  margin-left: calc(var(--card-width) / 4); /* Move right to meet in the middle */
}

.content-card .card-bg {
  background-image: var(--content-card-gradient);
}

/* Card header */
.card-header {
  position: relative;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  z-index: 2;
  cursor: pointer;
  transition: background-color var(--card-transition);
}

/* Add a subtle indicator that the header is clickable when card is expanded */
.feature-card.expanded .card-header::after {
  content: '';
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='18 15 12 9 6 15'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.feature-card.expanded .card-header:hover::after {
  opacity: 1;
}

/* Add a subtle hover effect to the header */
.feature-card.expanded .card-header:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Card color bar */
.card-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background-color: currentColor;
  z-index: 3;
}

/* Card icon */
.card-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  background-color: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: transform var(--card-transition);
  flex-shrink: 0;
}

.card-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

/* Card title */
.card-title {
  font-size: 1.25rem;
  font-weight: var(--font-weight-semibold);
  margin: 0;
  color: white;
  transition: transform var(--card-transition);
}

/* Card content */
.card-content {
  padding: 0 20px 20px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  line-height: 1.5;
  transition: opacity var(--card-transition);
}

/* Card expanded content */
.card-expanded-content {
  padding: 0 20px 20px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  line-height: 1.5;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all var(--card-transition);
}

/* Card solution */
.card-solution {
  margin-top: 15px;
  padding: 15px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  border-left: 3px solid currentColor;
}

.card-solution-label {
  font-weight: var(--font-weight-semibold);
  color: currentColor;
  display: block;
  margin-bottom: 5px;
}

/* Card background */
.card-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.05;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity var(--card-transition);
  z-index: 1;
  pointer-events: none;
}

/* Card hover state */
.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-shadow-hover);
}

.feature-card:hover .card-icon {
  transform: scale(1.1);
}

.feature-card:hover .card-bg {
  opacity: 0.08;
}

/* Card active/expanded state */
.feature-card.expanded {
  height: var(--card-expanded-height);
  box-shadow: var(--card-shadow-active);
  transform: translateY(-10px);
  z-index: 10;
}

.feature-card.expanded .card-expanded-content {
  opacity: 1;
  max-height: 1000px;
}

.feature-card.expanded .card-bg {
  opacity: 0.12;
}

/* Card toggle button */
.card-toggle {
  position: absolute;
  bottom: 15px;
  right: 15px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all var(--card-transition);
  z-index: 3;
}

.card-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform var(--card-transition);
}

.feature-card.expanded .card-toggle svg {
  transform: rotate(180deg);
}

.feature-card:hover .card-toggle {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Card colors */
.domain-card {
  color: var(--domain-card-color);
}

.domain-card .card-bg {
  background-image: var(--domain-card-gradient);
}

.client-card {
  color: var(--client-card-color);
}

.client-card .card-bg {
  background-image: var(--client-card-gradient);
}

.keyword-card {
  color: var(--keyword-card-color);
}

.keyword-card .card-bg {
  background-image: var(--keyword-card-gradient);
}

.deployment-card {
  color: var(--deployment-card-color);
}

.deployment-card .card-bg {
  background-image: var(--deployment-card-gradient);
}

/* Remove center logo styles */

/* Remove connection lines */
.connection-lines {
  display: none;
}

/* Down arrow */
.cards-arrow {
  position: relative;
  width: 60px;
  height: 60px;
  margin: 20px auto 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom, rgba(var(--brand-primary-rgb), 0.9), rgba(var(--brand-secondary-rgb), 0.9));
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), 0 0 30px rgba(var(--brand-primary-rgb), 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: bounce 2s infinite;
}

.cards-arrow:hover {
  background: linear-gradient(to bottom, rgba(var(--brand-primary-rgb), 1), rgba(var(--brand-secondary-rgb), 1));
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 40px rgba(var(--brand-primary-rgb), 0.6);
  transform: scale(1.1);
}

.cards-arrow svg {
  width: 24px;
  height: 24px;
  stroke: white;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.7));
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-12px);
  }
  60% {
    transform: translateY(-6px);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .feature-cards-container {
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 0;
  }
  
  :root {
    --card-width: 100%;
    --card-height: 180px;
    --card-expanded-height: 350px;
  }
  
  /* Stack cards vertically on mobile */
  .feature-card {
    width: 90%;
    max-width: 400px;
    margin: 0 auto;
  }
  
  /* Adjust card hover state for mobile */
  .feature-card:hover {
    transform: translateY(-5px);
  }
  
  /* Adjust card expanded state for mobile */
  .feature-card.expanded {
    transform: translateY(-10px);
  }
}
