/**
 * Events styles
 */

/* Event submission form styles */
.event-submission-form {
    max-width: 800px;
    margin: 50px auto;
    padding: 0 20px;
}

@media (max-width: 768px) {
    .event-submission-form {
        margin: 2rem auto;
        padding: 0 10px;
    }
}


.event-submission-errors {
    background-color: #ffebe8;
    border: 1px solid #c00;
    padding: 0.5rem 1rem;
    margin-bottom: 1.5rem;
}

.event-submission-errors .error-message {
    color: #c00;
    margin: 0.5rem 0;
}

.event-submission-success {
    background-color: #e7f9e7;
    border: 1px solid #0a0;
    padding: 1.5rem;
    margin: 50px auto;
    max-width: 800px;
    text-align: center;
}

@media (max-width: 768px) {
    .event-submission-success {
        margin: 2rem auto;
        padding: 1.5rem 10px;
    }
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.form-row .form-group {
    flex: 1 0 300px;
    padding: 0 10px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.8em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="datetime-local"],
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-family: inherit;
    font-size: 1rem;
    color: #333;
    background-color: #fff;
    box-sizing: border-box;
}

/* Normalize datetime-local input cross-browser */
.form-group input[type="datetime-local"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.submit-row {
    margin-top: 2rem;
}

.event-submit-button {
    background-color: #e50050;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.event-submit-button:hover {
    background-color: #c40046;
}

.required {
    color: #e50050;
}

.required-note {
    margin-top: 1rem;
    color: #666;
}

@media (max-width: 600px) {
    .form-row .form-group {
        flex: 1 0 100%;
    }
}

.events-list p {
    display: none;
}

/* Container */
.block-events {
  margin: 4rem; /* Default margin that can be overridden via shortcode */
}

/* Remove all <br> tags inside containers where they shouldn't be */
.event-meta br,
.event-details br,
.event-header br,
.event-date br,
.event-actions br {
  display: none !important;
}

@media (max-width: 768px) {
  .block-events {
    margin: 1rem 0; /* Default mobile margin */
  }
}

/* Event list */
.events-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Event item */
.event-item {
  padding: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #CFCFCF;
  background-color: #F4F4F4;
}

.event-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

/* Event date */
.event-date {
  display: inline-block;
  vertical-align: top;
  min-width: 50px;
  padding: 5px 8px;
  text-align: center;
  line-height: 1;
  flex: 0 0 auto;
  color: #e50050;
  margin-right: 1rem;
}

.event-day {
  display: block;
  font-size: 1.2em;
  font-weight: 700;
}

.event-month {
  display: block;
  font-size: 0.8em;
  text-transform: uppercase;
}

/* Event details */
.event-details {
  flex: 1;
  min-width: 0; /* Prevent flex items from overflowing */
}

.event-title {
  font-size: 1.1em;
  margin: 0 0 0.5em 0;
  color: #000;
}

/* Event meta information */
.event-meta {
  display: flex;
  flex-direction: column;
  color: #555;
  font-size: 0.85em;
}

.event-meta p {
  margin: 0;
  padding: 0;
}

.event-time,
.event-location,
.event-ticket {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.2em;
  display: block;
}

.event-ticket a {
  color: #e50050;
  text-decoration: none;
}

/* Event actions */
.event-actions {
  display: flex;
  align-items: center;
  margin-left: 1rem;
  line-height: 1;
}

.event-show-details {
  background: #e50050;
  color: white;
  border: none;
  border-radius: 3px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  font-size: 0.8em;
  text-transform: uppercase;
  white-space: nowrap;
  display: inline-block;
  line-height: 1.2;
}

.event-show-details:hover {
  background: #c40046;
}

/* Dialog styles */
.event-dialog {
  padding: 0;
  border: none;
  border-radius: 5px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
}

.event-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

.dialog-content {
  padding: 1.5rem;
}

.dialog-title {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #e50050;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.5rem;
}

.dialog-body {
  margin-bottom: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

.dialog-body p {
  display: block; /* Ensure paragraphs inside the dialog are visible */
  margin-bottom: 1em; /* Add some default spacing */
}

.dialog-close {
  background: #e50050;
  color: white;
  border: none;
  border-radius: 3px;
  padding: 0.4rem 1rem;
  cursor: pointer;
  font-size: 0.9em;
  line-height: 1.2;
}

.dialog-close:hover {
  background: #c40046;
}

/* No events message */
.no-entry {
  font-size: 1rem;
  color: #666;
  font-style: italic;
  text-align: left;
  padding: 2rem 0;
  margin: 3em 0;
}

/* Admin column styles */
.event-status {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  color: #fff;
}

.event-status.status-publish {
  background-color: #46b450;
}

.event-status.status-draft {
  background-color: #f56e28;
}

.event-status.status-pending {
  background-color: #ffb900;
}

.event-status.status-future {
  background-color: #00a0d2;
}

.event-status.status-private {
  background-color: #8e44ad;
}

.event-status.status-trash {
  background-color: #b32d2e;
}

/* Widget styles */
.sk-widget {
  margin-bottom: 2rem;
}

.widget-title {
  margin-top: 0;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #ddd;
}

.sk-widget .events-list {
  margin-bottom: 0;
}

.sk-widget .event-item {
  padding: 0.7rem 0;
  margin-bottom: 0.5rem;
  background-color: transparent;
}

.sk-widget .event-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.sk-widget .event-date {
  min-width: auto;
  padding: 0;
  margin-right: 0.5rem;
}

.sk-widget .event-title {
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.sk-widget .event-meta {
  font-size: 0.8em;
}

.sk-widget .event-show-details {
  padding: 0.2rem 0.4rem;
  font-size: 0.75em;
}

/* Override container margin for widget */
.sk-widget .block-events {
  margin: 0;
}

/* Gated content styles */
.sk-gated-hidden {
    display: none !important;
}

.sk-gated-content {
    margin: 1.5rem auto;
    max-width: 100%;
    box-sizing: border-box;
}

.sk-gated-label {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.75rem;
    cursor: pointer;
    padding: 1rem 1.5rem;
    background-color: #F4F4F4;
    border: 1px solid #CFCFCF;
    border-radius: 3px;
    font-weight: 600;
    line-height: 1.4;
    box-sizing: border-box;
    width: 100%;
}

.sk-gated-label input[type="checkbox"] {
    margin: 0 !important;
    flex-shrink: 0;
    width: 1.1em;
    height: 1.1em;
}

.sk-gated-label span {
    flex: 1;
}

/* Responsive styles */
@media (max-width: 768px) {
  .event-header {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .event-date {
    margin-bottom: 0.5rem;
  }
  
  .event-details {
    flex: 1 0 calc(100% - 80px);
    margin-bottom: 0.5rem;
  }
  
  .event-actions {
    margin-left: auto;
    margin-top: 0.5rem;
  }
  
  .event-dialog {
    width: 95%;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .event-details {
    flex: 1 0 100%;
  }
  
  .event-actions {
    margin-left: 0;
    margin-top: 0.5rem;
  }
}
