/**
 * @file
 * Field Group Horizontal Tabs Styling for CAGP theme.
 * Matches Drupal 7 legacy event page tab structure.
 */

/* ========================================
   Field Group Horizontal Tabs System
   ======================================== */

/* Main field group tabs wrapper */
.field-group-htabs-wrapper {
  margin: 20px 0;
  background: #ffffff;
  border: 1px solid #d3d7d9;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
}

/* Horizontal tabs container */
.horizontal-tabs {
  position: relative;
  background: #ffffff;
}

.horizontal-tabs.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* Horizontal tabs list */
.horizontal-tabs-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid #d3d7d9;
  background: #f8f9fa;
  display: flex;
  flex-wrap: wrap;
}

/* Individual tab buttons */
.horizontal-tab-button {
  position: relative;
  border-right: 1px solid #d3d7d9;
  background: #f8f9fa;
  margin: 0;
  padding: 0;
}

.horizontal-tab-button:last-child {
  border-right: none;
}

.horizontal-tab-button.first {
  border-left: none;
}

.horizontal-tab-button.last {
  border-right: none;
}

/* Selected/Active tab state */
.horizontal-tab-button.selected {
  background: #ffffff;
  border-bottom: 1px solid #ffffff;
  margin-bottom: -1px;
  z-index: 2;
  position: relative;
}

/* Tab button links */
.horizontal-tab-button a {
  display: block;
  padding: 12px 20px;
  color: #253980;
  text-decoration: none;
  font-size: 14px;
  font-weight: normal;
  font-family: 'Clear Sans', Arial, sans-serif;
  line-height: 1.4;
  border: none;
  background: transparent;
  transition: all 0.3s ease;
  cursor: pointer;
}

.horizontal-tab-button a:hover {
  color: #1e6fa8;
  background: rgba(39, 134, 194, 0.05);
  text-decoration: none;
}

.horizontal-tab-button.selected a {
  color: #253980;
  font-weight: bold;
  background: #ffffff;
  border-bottom: 1px solid #ffffff;
}

/* Tab content - strong styling like legacy */
.horizontal-tab-button a strong {
  font-weight: bold;
  color: inherit;
}

/* Tab summary text */
.horizontal-tab-button .summary {
  display: inline;
  font-size: 12px;
  color: #666;
  margin-left: 5px;
}

.horizontal-tab-button.selected .summary {
  color: #333;
}

/* Active tab indicator for screen readers */
#active-horizontal-tab {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Horizontal tabs panes container */
.horizontal-tabs-panes {
  background: #ffffff;
  padding: 0;
  margin: 0;
  position: relative;
}

.horizontal-tabs-panes.horizontal-tabs-processed {
  min-height: 200px;
}

/* Individual pane/fieldset */
.horizontal-tabs-pane {
  display: none;
  padding: 25px;
  border: none;
  margin: 0;
  background: #ffffff;
}

.horizontal-tabs-pane.selected {
  display: block;
}

/* Fieldset styling within panes */
.horizontal-tabs-pane fieldset {
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
}

.horizontal-tabs-pane .fieldset-legend {
  display: none;
}

.horizontal-tabs-pane .fieldset-wrapper {
  padding: 0;
  margin: 0;
}

/* Event Info specific styling */
.group-event-info.horizontal-tabs-pane {
  padding: 25px;
  background: #ffffff;
}

/* View content within tabs */
.horizontal-tabs-pane .view {
  margin: 0;
  padding: 0;
  background: transparent;
}

.horizontal-tabs-pane .view-content {
  margin: 0;
}

/* Views rows within tabs */
.horizontal-tabs-pane .views-row {
  margin-bottom: 20px;
  padding: 0;
  background: transparent;
  border: none;
}

.horizontal-tabs-pane .views-row:last-child {
  margin-bottom: 0;
}

/* Views fields styling */
.horizontal-tabs-pane .views-field {
  margin-bottom: 15px;
}

.horizontal-tabs-pane .views-field:last-child {
  margin-bottom: 0;
}

.horizontal-tabs-pane .views-label {
  font-weight: bold;
  color: #253980;
  display: inline;
  margin-right: 5px;
}

.horizontal-tabs-pane .field-content {
  display: inline;
  color: #333;
  line-height: 1.6;
}

/* Button styling within tabs */
.horizontal-tabs-pane .button {
  display: inline-block;
  background: #2786c2;
  color: white !important;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.horizontal-tabs-pane .button:hover {
  background: #1e6fa8;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(39, 134, 194, 0.3);
}

/* Responsive design for tabs */
@media (max-width: 768px) {
  .horizontal-tabs-list {
    flex-direction: column;
  }

  .horizontal-tab-button {
    border-right: none;
    border-bottom: 1px solid #d3d7d9;
    width: 100%;
  }

  .horizontal-tab-button:last-child {
    border-bottom: none;
  }

  .horizontal-tab-button.selected {
    border-bottom: none;
    margin-bottom: 0;
  }

  .horizontal-tabs-pane {
    padding: 15px;
  }
}

/* Integration with CAGP layout */
.left-part .field-group-htabs-wrapper {
  margin: 0 0 20px 0;
  width: 100%;
}

.left-part .horizontal-tabs-pane {
  font-family: 'Clear Sans', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

.left-part .horizontal-tabs-pane h3 {
  color: #253980;
  font-size: 18px;
  font-weight: bold;
  margin: 15px 0 10px 0;
}

.left-part .horizontal-tabs-pane p {
  margin: 10px 0;
  line-height: 1.6;
}

/* Hide element-invisible for screen readers */
.element-invisible {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  overflow: hidden;
  height: 1px;
  width: 1px;
}