/* CBK Portals Widget Styles */
.cbk-portals-widget {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  padding: 25px;
  margin-bottom: 30px;
  font-family: "Helvetica Neue", sans-serif;
  color: #333;
  border: 1px solid #eee;
}

.cbk-portals-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.cbk-portals-title {
  font-size: 24px;
  color: #2c3e50;
  margin: 0;
  font-weight: 700;
}

.cbk-portals-view-all {
  font-size: 16px;
  color: #3498db;
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.3s ease;
  position: relative;
  padding-bottom: 5px;
}

.cbk-portals-view-all:hover {
  color: #2980b9;
}

.cbk-portals-view-all::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background-color: #3498db;
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease-out;
}

.cbk-portals-view-all:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

.cbk-portals-view-all .fas.fa-arrow-right {
  font-size: 0.9em;
}

.cbk-portals-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 15px; /* Space between buttons */
  justify-content: flex-start; /* Align items to the start */
}

.cbk-portal-button {
  flex: 1 1 calc(20% - 12px); /* 5 items per row, accounting for gap */
  min-width: 180px; /* Minimum width for responsiveness */
  background-color: #2c3e50; /* Dark blue from screenshot */
  color: #fff;
  text-decoration: none;
  padding: 15px 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cbk-portal-button:hover {
  background-color: #34495e; /* Slightly lighter blue on hover */
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.cbk-portal-icon-wrapper {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #fff; /* White background for icon/image */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cbk-portal-image {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Ensure image fits within the circle */
  border-radius: 50%;
}

.cbk-portal-icon {
  color: #2c3e50; /* Dark blue icon color */
  font-size: 20px;
}

.cbk-portal-text {
  flex-grow: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cbk-portal-arrow {
  flex-shrink: 0;
  font-size: 1em;
  transition: transform 0.2s ease;
}

.cbk-portal-button:hover .cbk-portal-arrow {
  transform: translateX(5px);
}

.no-portals-message {
  width: 100%;
  text-align: center;
  font-style: italic;
  color: #7f8c8d;
  padding: 20px;
  border: 1px dashed #e0e0e0;
  border-radius: 5px;
  background-color: #f9f9f9;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .cbk-portal-button {
    flex: 1 1 calc(25% - 11.25px); /* 4 items per row */
  }
}

@media (max-width: 992px) {
  .cbk-portal-button {
    flex: 1 1 calc(33.333% - 10px); /* 3 items per row */
  }
}

@media (max-width: 768px) {
  .cbk-portals-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .cbk-portals-view-all {
    margin-left: auto; /* Push to right if space allows */
  }
  .cbk-portal-button {
    flex: 1 1 calc(50% - 7.5px); /* 2 items per row */
  }
}

@media (max-width: 576px) {
  .cbk-portal-button {
    flex: 1 1 100%; /* 1 item per row */
  }
}

/* Admin Widget Form Styles (for repeater) */
.cbk-portals-repeater .portals-list {
  border: 1px solid #ccc;
  padding: 10px;
  margin-bottom: 15px;
  background-color: #f9f9f9;
}

.cbk-portals-repeater .portal-item {
  background-color: #fff;
  border: 1px solid #eee;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 4px;
  position: relative;
}

.cbk-portals-repeater .portal-item h4 {
  margin-top: 0;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1em;
}

.cbk-portals-repeater .portal-item h4 .remove-portal-item {
  color: #a00;
  text-decoration: none;
  font-size: 0.8em;
  padding: 0;
  height: auto;
  line-height: 1;
}

.cbk-portals-repeater .portal-item h4 .remove-portal-item:hover {
  color: #dc3232;
}

.cbk-portals-repeater .portal-item p {
  margin-bottom: 10px;
}

.cbk-portals-repeater .portal-item label {
  font-weight: 600;
  display: block;
  margin-bottom: 5px;
}

.cbk-portals-repeater .portal-item input[type="text"],
.cbk-portals-repeater .portal-item input[type="url"] {
  width: 100%;
  box-sizing: border-box;
}

.cbk-portals-repeater .portal-item .button.select-portal-image,
.cbk-portals-repeater .portal-item .button.remove-portal-image {
  margin-top: 5px;
  margin-right: 5px;
}
