/* styles.css */

/* Global styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
}

body {
  font-family: 'Arial', sans-serif;
  line-height: 26px;
  color: #333;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background: radial-gradient(circle at top right, #F4E9FB 10%, white 70%);
  min-height: 100vh;
  background-attachment: fixed;
}

.hidden {
  display: none !important;
}

/* Top section with home and language selector */
.event-portal-page-header {
  margin-top: 20px;
  margin-bottom: 20px;
}

.event-portal-top-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  margin-bottom: 10px;
}

.event-portal-header-title {
  font-size: 32px;
  margin: 0;
  text-align: start;
}

.event-portal-home-section {
  display: flex;
  gap: 8px;
  text-decoration: none;
}

.event-portal-home-icon {
  width: 20px;
  height: 20px;
}

.event-portal-home-text {
  font-size: 16px;
  color: #333;
  font-weight: 500;
}

.event-portal-language-container {
  display: flex;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

#event-portal-language-select {
  padding: 8px 28px 8px 12px;
  border: 1px solid #e0d4e8;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23555' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 18px;
  min-width: 180px;
}

#event-portal-language-select:focus {
  outline: none;
  border-color: #cda6e6;
  box-shadow: 0 3px 8px rgba(244, 233, 251, 0.4);
}

.event-portal-header-content {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding-bottom: 15px;
  position: relative;
}

/* Search bar */
.event-portal-search-container {
  min-width: 280px;
  flex-grow: 1;
  max-width: 500px;
  display: flex;
  justify-content: flex-end;
}

.event-portal-search-input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.event-portal-search-icon {
  position: absolute;
  left: 15px;
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: 1;
}

.event-portal-search-icon img {
  width: 15px;
  height: 15px;
  opacity: 0.6;
}

#event-portal-search-input {
  padding: 12px 15px 12px 40px;
  width: 100%;
  border: 1px solid #e0d4e8;
  border-radius: 6px;
  font-size: 14px;
  background-color: rgba(255, 255, 255, 0.8);
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

#event-portal-search-input:focus {
  outline: none;
  border-color: #cda6e6;
  background-color: white;
  box-shadow: 0 3px 8px rgba(244, 233, 251, 0.4);
}

/* Sort dropdown */
.event-portal-sort-container {
  display: flex;
  align-items: center;
  margin-inline-start: 15px;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

#event-portal-sort-select {
  padding: 12px 32px 12px 15px; /* Increased right padding to make room for the arrow */
  border: 1px solid #e0d4e8;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none; /* Remove default arrow */
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23555' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 18px;
}

#event-portal-sort-select:focus {
  outline: none;
  border-color: #cda6e6;
  box-shadow: 0 3px 8px rgba(244, 233, 251, 0.4);
}

/* Events grid */
#event-portal-events-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 25px;
  position: relative;
  z-index: 1;
}

.event-portal-event-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  background-color: white;
  height: 320px;
  display: flex;
  flex-direction: column;
}

.event-portal-event-card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.event-portal-event-details {
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.event-portal-event-name {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 10px;
}

.event-portal-event-date {
  color: #666;
  margin-bottom: 8px;
  display: flex;
}

.event-portal-event-date .event-portal-calendar-icon {
  margin-inline-end: 8px;
  flex-shrink: 0;
}

.event-portal-event-description {
  margin-top: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5em;
  max-height: 4.5em;
  position: relative;
  flex-grow: 1;
}

.event-portal-event-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 15px;
}

.event-portal-fully-booked {
  color: #d32f2f;
  font-weight: bold;
  margin-inline-start: 10px;
}

.event-portal-event-link {
  display: inline-block;
  background-color: #0078d4;
  color: white;
  padding: 8px 15px;
  text-decoration: none;
  border-radius: 4px;
  text-align: center;
  font-weight: bold;
}

.event-portal-event-link:hover {
  background-color: #005a9e;
}

/* Event details page */
.event-portal-page-main {
  width: 100%;
}

.event-portal-event-details-page {
  background: white;
  max-width: none;
  padding: 0;
  display: flex;
  justify-content: start;
  flex-direction: column;
  max-width: 1200px;
  padding: 20px;
  min-height: 100vh;
  background: white;
  background-image: none;
}

#event-portal-registration-form-container {
  width: 100%;
  margin: 0 auto;
  padding: 20px;
}

.event-portal-registration-form-wrapper {
  width: 100%;
}

/* Loading state */
#event-portal-loading-message {
  text-align: center;
  padding: 40px;
  font-size: 20px;
  color: #666;
}

/* Error message */
.event-portal-error-message {
  color: #721c24;
  text-align: center;
  padding: 20px;
  font-size: 20px;
  background-color: #ffebee;
  border-radius: 4px;
  margin: 20px 0;
}

/* API Error display */
#event-portal-api-error {
  background-color: #ffebee;
  color: #721c24;
  padding: 12px 20px;
  font-size: 16px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  line-height: 1.4;
}

/* Responsive styling */
@media (max-width: 768px) {
  #event-portal-events-container {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  }
  
  body {
    padding: 10px;
  }
  
  .event-portal-header-content {
    flex-direction: column;
    align-items: stretch;
  }
  
  .event-portal-search-container {
    max-width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  #event-portal-events-container {
    grid-template-columns: 1fr;
  }
  
  .event-portal-event-card {
    height: auto;
    min-height: 320px;
  }
}
