/**
 * Ticino Adventures Notification Bar Frontend Styles
 */

/* Main wrapper - updated ID */
#tanb-wrap {
  position: fixed; /* Make bar fixed */
  top: 0;
  left: 0;
  width: 100%;
  box-sizing: border-box;
  background-color: #0eaa4a; /* Default */
  color: #ffffff; /* Default */
  z-index: 99999; /* Ensure it's above most elements */
}

/* Updated class */
#tanb-wrap.tanb-hidden {
  display: none;
}

/* Inner container - updated class */
.tanb-container {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

/* New wrapper for content and button */
.tanb-content-button-wrapper {
  display: flex; /* Arrange content and button side-by-side */
  align-items: center; /* Vertically align text and button */
  flex-grow: 1; /* Make this wrapper take the available space */
  margin-right: 15px; /* Add space before the close button */
  justify-content: center; /* Center content+button within the available space */
}

/* Content area - updated class */
.tanb-content {
  text-align: center; /* Reverted back to center */
  text-wrap: balance; /* Add text balancing */
}

.tanb-content p {
  margin: 0;
  padding: 0;
}

/* Button wrapper - updated class */
.tanb-button-wrap {
  flex-shrink: 0;
  margin-left: 15px; /* Space from text */
}

/* Button styling - updated class */
.tanb-button {
  display: inline-block;
  padding: 5px 15px;
  background-color: rgba(255, 255, 255, 0.2);
  color: inherit;
  text-decoration: none;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  font-size: 0.9em;
  transition: background-color 0.2s ease;
}

.tanb-button:hover,
.tanb-button:focus {
  background-color: rgba(255, 255, 255, 0.4);
  color: inherit;
}

/* Close button wrapper - updated class */
.tanb-close-wrap {
  flex-shrink: 0;
  margin-left: auto; /* Keep pushed to the far right */
}

/* Close button styling - updated class */
.tanb-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  padding: 0 10px;
  opacity: 0.8;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tanb-close:hover,
.tanb-close:focus {
  opacity: 1;
}

/* Clickable bar styling - updated ID and class */
#tanb-wrap.tanb-clickable {
  cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .tanb-container {
    flex-direction: column;
    text-align: center;
    padding: 15px;
  }

  /* Adjust wrapper for column layout */
  .tanb-content-button-wrapper {
    flex-direction: column; /* Stack text and button */
    margin-right: 0; /* No right margin needed */
    margin-bottom: 10px; /* Add space before close button */
    width: 100%; /* Take full width */
    justify-content: center; /* Keep centering */
    order: 1; /* Content+Button group first */
  }

  .tanb-content {
    text-align: center; /* Ensure center alignment remains */
  }

  .tanb-button-wrap,
  .tanb-close-wrap {
    margin-left: 0;
    margin-top: 10px;
  }

  .tanb-close-wrap {
    order: 2; /* Close button second */
  }
}
