/* event_search.css */

/* Add will-change for elements that animate */


/* Optimize sticky positioning */
.date-group-mobile {
    top: 0;
    z-index: 120;
    transform: translateZ(0); /* Hardware acceleration */
}

/* Reduce layout shifts */
.table-container {

    overflow-x: auto;
}

/* Optimize images */


/* Batch style updates */


/* View toggle styles */
.view-toggle-container {
    display: none;
    justify-content: center;
    margin: 10px 0;
    gap: 10px;
}

.view-toggle-btn {
    padding: 8px 16px;
    background: #2E7D32;
    color: #ffffff;
    border: 2px solid #555;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 5px 
  }

.view-toggle-btn:hover {
    background: #45a049;
    border: 2px solid red;
}

.view-toggle-btn.active {
    background: #4CAF50;
    border: 2px solid #00ffff;
}

/* Mobile list view styles */
.mobile-cards-view,
.mobile-list-view {
    position: relative;
    min-height: 100vh;
}

.mobile-list-view {
    display: none;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 5px;
}

.mobile-list-view.active {
    display: block;
}

.mobile-cards-view {
    display: none;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 8px;
}

.mobile-cards-view.active {
    display: block;
}

/* List view specific styles */
.list-event-item {
    background-color: #222222;
    border: 1px solid #555;
    border-radius: 4px;
    margin: 5px 0;
    padding: 0 5px;
    display: grid;
    grid-template-columns: 60px 1fr 40px;
    grid-template-rows: auto auto;
    gap: 4px;
    min-height: 50px;
}

.list-event-item:nth-child(even) {
    background-color: #3d3d3d;
}

.event-link {
  /* Increase touch target size for mobile */
  display: inline-block;
  padding: 2px 2px;           /* Ample tap area */
  font-size: 1.0rem;             /* Larger, readable text */
  font-weight: bold;
  color: #00ffff !important;                /* High contrast blue (adjust to your palette) */
  text-decoration: underline;    /* Traditional link underline */
  background-color: ;     /* Light background for contrast */
  border-radius: 8px;            /* Optional: softer corners */
  transition: border 0.2s ease;  /* Smooth hover effect */
}

/* Hover state – red border */
.event-link:hover {
  border: 2px solid red;         /* Clearly visible red border */
}

/* Also provide a focus style for keyboard users */
.event-link:focus {
  outline: 2px solid red;
  outline-offset: 2px;
}

.date-group-mobile {
    background-color: red !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
    font-weight: bold;
    font-size: 14px;
    margin: 6px 0 2px 0;
    padding: 6px 10px;
    border-radius: 5px;
    border: 2px solid #ffd700;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 120;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}

.list-time {
    grid-column: 1;
    grid-row: 1 / span 2;
    background-color: #4a648c;
    color: white;
    padding: 4px;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 13px;
    height: 100%;
}

.list-event-header {
    grid-column:2;
    grid-row: 1;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.list-event-name {
    font-weight: bold;
    font-size: 14px;
    color: #ffffff;
    flex: 1;
    min-width: 0;
}

.list-event-name a {
    color: #00ffff !important;
    text-decoration: none;
    font-weight: bold;
}

.list-event-name a:hover {
    color: #ff9900 !important;
    text-decoration: underline;
}

.list-event-type {
    color: #FFFFFF;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 1px;
}

.list-event-type a {
    color: #00ffff;
    text-decoration: none;
}

.list-event-type a:hover {
    color: #ff9900;
    text-decoration: underline;
}

.list-event-details {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #cccccc;
    min-height: 20px;
}

.list-event-venue {
    color: #cccccc;
    font-size: 14px;
    grid-column: 2;
    text-align: left;
    justify-self: start; 
    flex: 1;
    min-width: 0;
}

.list-event-location {
    color: #FFFFFF;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
}

.venue-dropdown {
    display: inline-block;
    max-width: 100%;
}

.venue-dropbtn {
    background: none;
    border: none;
    color: #00ffff;
    padding: 0;
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    text-align: left;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

.list-actions {
    grid-column: 3;
    grid-row: 1 / span 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    padding-top: 2px;
}

/* Calendar dropdown for list view */
.list-actions .calendar-dropdown {
    margin-top: 0;
}

.list-actions .calendar-dropbtn {
    background: none;
    border: none;
    color: #4CAF50;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Adjust venue dropdown for list view */
.list-event-details .venue-dropdown-content {
    font-size: 11px;
    min-width: 90px;
    bottom: 100%;
    top: auto;
}

/* Mobile-specific adjustments */
@media (max-width: 767px) {
    .mobile-list-view .list-event-details {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 6px;
        font-size: 10px;
        width: 100%;
    }
    
    .mobile-list-view .list-event-venue {
        flex: 0 0 45%;  /* Fixed 45% width */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .mobile-list-view .list-event-location {
        flex: 0 0 45%;  /* Fixed 45% width */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        color: #aaaaaa;
    }
    
    /* Separator between venue and location */
    .mobile-list-view .list-event-details {
        position: relative;
    }
    
    .mobile-list-view .list-event-details::after {
        content: "|";
        color: #555;
        font-size: 8px;
        position: absolute;
        left: 45%;
        transform: translateX(-50%);
    }
    
    .mobile-list-view .list-event-item {
        grid-template-columns: 50px 1fr 35px;  /* Keep existing grid */
    }
    
    .mobile-list-view .list-event-header {
        grid-column: 2;
        grid-row: 1;
        display: grid;  /* Change from flex to grid */
        grid-template-columns: 45% 45% 10%;  /* Name 40%, Type 40%, Calendar 20% */
        align-items: center;
        gap: 4px;
        width: 100%;
    }
    
    .mobile-list-view .list-event-name {
        grid-column: 1;
        font-weight: bold;
        font-size: 11px;
        color: #ffffff;
        min-width: 0;  /* Allow shrinking */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;  /* Keep on one line with ellipsis */
    }
    
    .mobile-list-view .list-event-type {
        grid-column: 2;
        color: #FFFFFF;
        font-size: 11px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;  /* Allow shrinking */
    }
    
    .mobile-list-view .list-actions {
        grid-column: 3;
        grid-row: 1 / span 2;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 2px;
        padding-top: 2px;
        width: 100%;
    }
    
    /* Make sure the event link fits properly */
    .mobile-list-view .list-event-name a.event-link {
        font-size: 11px;
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding: 2px 0;
        width: 100%;
    }
    
    .mobile-list-view .list-time {
        font-size: 11px;  /* Slightly smaller font */
        padding: 2px;     /* Reduced padding */
        line-height: 1.2; /* Tighter line height */
        min-height: auto; /* Remove any minimum height */
        height: auto;     /* Let it size naturally */
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    /* Optional: If you want to reduce the overall row height further */
    .mobile-list-view .list-event-item {
        grid-template-columns: 40px 1fr 35px;  /* Slightly narrower time column */
        padding: 4px 6px;  /* Reduced overall padding */
        gap: 3px;
        min-height: 45px;  /* Control minimum row height */
    }
    
    /* Adjust the calendar button size */
    .mobile-list-view .calendar-dropbtn {
        font-size: 10px;
        padding: 2px;
        white-space: nowrap;
    }
    @media (max-width: 375px) {
        .mobile-list-view .list-event-name a.event-link {
            font-size: 10px;
        }
    }
    
    .list-event-item {
        grid-template-columns: 50px 1fr 35px;
        padding: 6px;
        gap: 3px;
    }
    
    .list-event-name {
        font-size: 12px;
         font: 400;
    }
    
    .list-event-type {
        font-size: 12px;
       
    }
    
    .list-event-details {
        font-size: 11px;
        gap: 5px;
    }
    
    .list-event-venue,
    .list-event-location {
        font-size: 13px;
    }
    
    .venue-dropbtn {
        font-size: 11px;
    }
    
    .list-time {
        font-size: 12px;
        padding: 3px;
    }
    
    /* Adjust existing mobile cards view to work with toggle */
    .table-container table {
        display: none;
    }
    
    .view-toggle-container {
        display: flex !important;
    }
    
    /* Remove the old mobile-events-container styles and replace with new structure */
    .mobile-events-container {
        display: none;
    }
    
    .mobile-cards-view,
    .mobile-list-view {
        position: relative;
        overflow-x: visible;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        overflow-anchor: none;
        isolation: isolate;
    }

    .date-group-mobile {
        top: 0;
        margin-top: 0;
    }

    .mobile-cards-view .event-card {
        width: 100%;
        box-sizing: border-box;
        background-color: #222222;
        border: 2px solid #949292;
        border-radius: 8px;
        margin: 8px 0;
        padding: 12px;
        position: relative;
        -webkit-transform: translateZ(0);
    }
    
    .mobile-cards-view .event-card:nth-child(even) {
        background-color: #3d3d3d;
    }
    
    .mobile-cards-view .date-group-mobile {
        background-color: #4a148c;
        display: flex;
        justify-content: space-between;
        align-items: center;
        color: #ffffff;
        font-weight: bold;
        font-size: 14px;
        margin: 6px 0 2px 0;
        padding: 6px 10px;
        border-radius: 5px;
        border: 2px solid #ffd700;
        position: -webkit-sticky;
        position: sticky;
        top: 0px;
        z-index: 120;
    }
    
    .mobile-cards-view .event-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 5px;
        gap: 10px;
    }
    
    .mobile-cards-view .event-time {
        background-color: #4a148c;
        color: white;
        padding: 2px;
        border-radius: 6px;
        font-weight: bold;
        text-align: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
        font-size: 12px;
    }
    
    /* Mobile cards view - reduce event name height when it's a link */
@media (max-width: 767px) {
    .mobile-cards-view .event-name a.event-link {
        font-size: 13px;  /* Slightly smaller than the 13px non-linked events */
        line-height: 1.2;  /* Tighter line height */
        display: inline-block;
        padding: 1px 0;    /* Minimal padding */
        margin: 0;         /* Remove any margins */
        font-weight: normal; /* Optional: reduce from bold to normal */
        text-decoration: none;
    }
    
    /* Keep non-linked event names at original size */
    .mobile-cards-view .event-name {
        font-size: 13px;
        line-height: 1.3;
        min-height: auto;  /* Allow natural height */
    }
    
    /* Adjust the card header to be more compact for linked events */
    .mobile-cards-view .event-card-header {
        margin-bottom: 3px;  /* Reduce from 5px */
        gap: 8px;            /* Slightly smaller gap */
        align-items: center;
    }
    
    /* Make time display slightly smaller to match */
    .mobile-cards-view .event-time {
        font-size: 11px;
        padding: 2px 3px;
        line-height: 1.2;
    }
}

/* Even more compact for very small screens */
@media (max-width: 375px) {
    .mobile-cards-view .event-name a.event-link {
        font-size: 11px;
        line-height: 1.1;
    }
}
   
    .mobile-cards-view .event-name a:hover {
        color: #ff9900 !important;
        text-decoration: underline;
    }
    
    .mobile-cards-view .event-type-compact {
        display: flex;
        align-items: center;
        margin-bottom: 5px;
        font-size: 13px;
        min-height: 20px;
        white-space: nowrap;
        flex-wrap: nowrap;
    }
    
    .mobile-cards-view .type-label {
        color: #aaa;
        margin-right: 8px;
        font-weight: bold;
        min-width: 40px;
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    .mobile-cards-view .event-location-compact {
        display: flex;
        align-items: center;
        font-size: 13px;
        min-height: 20px;
        flex-wrap: nowrap;
        gap: 4px;
        white-space: nowrap;
        width: 100%;
    }
    
    .mobile-cards-view .location-label {
        color: #aaa;
        margin-right: 6px;
        font-weight: bold;
        min-width: 40px;
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    .mobile-cards-view .location-details {
        color: #ffffff;
        font-size: 13px;
        white-space: wrap;
        flex-shrink: 1;
        margin-left: 4px;
    }
    
    .mobile-cards-view .venue-dropbtn {
        background: none;
        border: none;
        color: #00ffff;
        padding: 0;
        font-size: 14px;
        cursor: pointer;
        text-decoration: underline;
        text-align: left;
        white-space: nowrap;
        max-width: 100%;
    }
}

/* Desktop: Show table, hide mobile views */
@media (min-width: 768px) {
    .table-container table {
        display: table;
    }
    .view-toggle-container,
    .mobile-list-view,
    .mobile-cards-view {
        display: none !important;
    }
}

/* Dark mode styles */
body {
    background-color: #1a1a1a;
    color: white;
}

.search-banner {
    padding: 1px; 
    margin-bottom: 0px; 
    background-color: #1a1a1a;
    border: 0px solid: #ccc; 
    border-radius: 4px; 
    text-align: center; 
    font-weight: 600; 
    font-size: 16px;
    color: white;
    display: inline;
}

.pagination-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 2px 0;
  font-size: 14px;
  max-width: 100vw;
  overflow: visible;
}

.pagination-info {
  margin-right: 10px;
  color: #aaa;
  text-align: center;
  width: 100%;
}

.pagination-links {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 5px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  max-width: 100%;
  justify-content: flex-start;
}

.pagination-links::-webkit-scrollbar {
  height: 6px;
}

.pagination-links::-webkit-scrollbar-track {
  background: #333;
  border-radius: 3px;
}

.pagination-links::-webkit-scrollbar-thumb {
  background: #666;
  border-radius: 3px;
}

.pagination-links::-webkit-scrollbar-thumb:hover {
  background: #888;
}

.pagination-links a {
  padding: 6px 10px;
  text-decoration: none;
  color: #00ffff;
  border-radius: 4px;
  background: #333;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 30px;
  text-align: center;
  font-size: 13px;
  transition: background 0.2s;
}

.pagination-links a:hover {
  color:  #ff9900;
  text-decoration: underline;    
  background-color: #444;
}

.pagination-links a:focus {
  outline: 2px solid #4CAF50;
  outline-offset: 2px;
}

.pagination-links a[disabled] {
  color: #555;
  cursor: not-allowed;
}

.current-page {
  padding: 6px 10px;
  background-color: #4CAF50;
  color: white;
  border-radius: 5px;
  font-weight: bold;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 30px;
  text-align: center;
  font-size: 13px;
}

/* Add event to Calendar link */
.calendar-dropdown {
    position: relative;
    display: inline-block;
    margin-left: 8px;
}

.calendar-dropbtn {
    background: none;
    border: none;
    color: #4CAF50;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    text-decoration: underline;
}

.calendar-dropdown-content {
    display: none;
    position: absolute;
    background-color: #333;
    min-width: 120px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
    z-index: 1000;
    border-radius: 4px;
    padding: 8px;
    left: 0;
    top: auto;
}

.calendar-dropdown-content a {
    color: #00ffff;
    padding: 4px 8px;
    text-decoration: none;
    display: block;
    font-size: 12px;
    border-bottom: 1px solid #555;
}

.calendar-dropdown-content a:hover {
    background-color: #444;
    color: #ff9900;
}

.calendar-dropdown:hover .calendar-dropdown-content {
    display: block;
}

/* Form styles */
.form-container {
    max-width: 980px;
    margin: 0 auto;
    padding: 15px;
    background-color: #2a2a2a;
    border: 2px solid #666;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    color: #f0f0f0;
    font-size: 16px;
}

form .form-group {
    display: flex;
    margin: 0 2px 4px;
    gap: 2px;
}

form label {
    position: absolute;
    top: -6px;
    left: 30px;
    background: #333;
    padding: 0 5px;
    font-size: 12px;
    color: #aaa;
}

form input, form select {
    width: 100%;
    padding: 1px;
    margin-bottom: 2px;
    border: 1px solid #555;
    border-radius: 4px;
    font-size: 16px;
    height: 33px;
    background-color: #444;
    color: #e0e0e0;
}

/* Table container */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 80vh;
  padding-left: 8px;
  max-width: 1000px;
  margin: 0 auto;
}

/* Table styles */
table {
  border-collapse: collapse;
  width: 100%;
}

/* Sticky header */
thead {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: pink;
}

th {
  background-color: pink;
  color: black;
  padding: 8px 3px;
  font-size: 15px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 101;
  box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.3);
}

/* Table rows */
tr {
  background-color: #222;
  color: #e0e0e0;
  font-size: 15px;
  padding: 3px 1px;
}

tr:nth-child(even) {
   background-color: #3d3d3d;
}

/* DATE ROWS */
.date-group,
.date-row {
  background-color: #4a148c !important;
  color: #ffffff !important;
  font-weight: bold;
  font-size: 15px;
  border-top: 2px solid #ffd700;
  border-bottom: 2px solid #ffd700;
  position: sticky;
  top: 40px;
  z-index: 99;
}

.date-row td:first-child {
  text-align: left !important;
  padding-left: 10px !important;
}

.date-group td,
.date-row td {
  padding-left: 25px !important;
  background-color: transparent !important;
  text-align: left;
}

/* Column-specific styles */
td:nth-child(1),
th:nth-child(1) {
  text-align: Center;
  padding-left: 5px;
  width: 60px;
}

/* Add styles for the venue dropdown */
.venue-dropdown {
    position: relative;
    display: inline-block;
}

.venue-dropbtn {
    background-color: transparent;
    color: #00ffff;
    padding: 0;
    font-size: inherit;
    border: none;
    cursor: pointer;
    text-decoration: underline;
}

.venue-dropdown-content {
    display: none;
    position: absolute;
    background-color: #333;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
    z-index: 105;
    border-radius: 4px;
    padding: 8px;
}

.venue-dropdown-content a {
    color: #00ffff;
    padding: 6px 8px;
    text-decoration: none;
    display: block;
    font-size: 14px;
}

.venue-dropdown-content a:hover {
    background-color: #444;
    color: #ff9900;
}

.venue-dropdown:hover .venue-dropdown-content {
    display: block;
}

/* Hide the eircode column */
th:nth-child(7),
td:nth-child(7) {
    display: none;
}

/* Link styles */
td a {
  color: #00ffff;
  text-decoration: none;
  display: block;
  padding: 10px 5px;
  margin: -10px -5px;
  min-height: 24px;
}

td a:hover,
td a:focus {
  color:  #ff9900;
  text-decoration: underline;
  background-color: rgba(255, 255, 255, 0.1);
  outline: none;
}

td a:focus-visible {
  box-shadow: 0 0 0 2px #4CAF50;
  border-radius: 3px;
}

/* Sort indicators */
th a span {
  margin-left: 3px;
  font-size: 14px;
}

.event-count {
    font-size: 12px;
    opacity: 0.9;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

.asc { color: green; }
.desc { color: red; }

/* Default Rule (Applies to the 1st Card after a date row) */
.calendar-dropdown-content {
    top: 100%;
    bottom: auto;
    z-index: 1001;
    left: auto;
    right: 0;
}

/* Specific Rule (Applies to all subsequent cards after the first) */
.event-card + .event-card .calendar-dropdown-content {
    top: auto;
    bottom: 100%;
    margin-bottom: 5px;
}

.calendar-dropdown .calendar-dropbtn {
    background: none;
    border: none;
    color: #4CAF50;
    cursor: pointer;
    font-size: 14px;
    padding: 5px;
    flex-shrink: 0;
    font-weight: bold;
}

.calendar-dropbtn span {
    color: #00ffff;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.event-card-content {
    margin-left: 20px;
}

/*  helps with rendering performance */
.event-card:not(.in-view) {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}

.event-type-row, {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 14px;
    min-height: 20px;
}

.event-type-label, .event-location-label {
    color: #aaa;
    margin-right: 6px;
    font-weight: bold;
    min-width: 40px;
    flex-shrink: 0;
    white-space: nowrap;
}

.event-type-link {
    color: #00ffff;
    text-decoration: none;
}

.event-type-link:hover {
    color: #ff9900;
    text-decoration: underline;
}

.venue-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.venue-dropdown {
    position: relative;
    display: inline-block;
    max-width: 40%;
    z-index: 110;
}

.venue-dropdown-content {
    display: none;
    position: absolute;
    background-color: #333;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
    z-index: 120;
    border-radius: 4px;
    padding: 8px;
    bottom: 100%;
    left: 0;
}

.venue-dropdown:hover .venue-dropdown-content {
    display: block;
}

.calendar-dropdown,
.venue-dropdown {
    position: relative;
    display: inline-block;
    z-index: 200;
}

.calendar-dropdown-content,
.venue-dropdown-content {
    z-index: 1000;
}

/* Safari support */
@supports (-webkit-touch-callout: none) {
    .date-group-mobile {
        top: -1px;
        -webkit-backface-visibility: hidden;
        -webkit-transform: translateZ(0);
    }
    
    .mobile-events-container {
        -webkit-overflow-scrolling: touch;
    }
}

/* Desktop styles */
@media (min-width: 768px) {
    .keyword-search-wrapper {
        width: 90%;
        color: white;
    }
}

.form-container {
    max-width: 600px;
    padding: 10px;
}

fieldset:first-of-type > div {
    display: flex;
    justify-content: space-between;
    gap: 5px;
}

fieldset:last-of-type .form-group {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.form-group:last-child {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

form input,
form select {
    height: 32px;
    font-size: 14px;
    padding: 8px;
}

form label {
    top: -4px;
}

/* Date search specific styles */
.date-search-fieldset {
    margin-bottom: 2px;
    border: 2px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    background-color: #333;
}

/* Legend improvements */
.date-search-fieldset legend {
    padding: 15px;
    font-size: 16px;
    color: #fff;
    font-weight: bold;
    background-color: #333;
    border-radius: 4px;
}

.date-search-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.date-input-group {
    display: flex;
    gap: 10px;
    width: 100%;
}

.date-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 120px;
}

.date-input-wrapper label {
    position: absolute;
    top: -10px;
    left: 15px;
    background: transparent;
    padding: 0 5px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    z-index: 1;
}

/* Input and select improvements */
.date-input-wrapper input,
#county, #town, #venue, #general_search {
    width: 100%;
    height: 44px !important;
    padding: 10px 12px !important;
    font-size: 18px !important;
    border: 2px solid #666;
    border-radius: 6px;
    background-color: #444;
    color: #fff;
    box-sizing: border-box;
}

#general_search::placeholder {
    color: #aaa;
    font-size: 16px;
}

.date-input-wrapper input:hover, #general_search:hover {
    background-color: #41425e;
    border-color: #4CAF50;
}

/* Focus states for better accessibility */
.date-input-wrapper input:focus,
#county:focus, #town:focus, #venue:focus, #general_search:focus {
    border-color: #4CAF50;
    outline: none;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}

/* Label improvements */
.date-input-wrapper label {
    position: absolute;
    top: -12px;
    left: 12px;
    background: #444;
    padding: 0 0px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    z-index: 2;
}

.date-search-button {
    position: relative;
    display: flex;
    justify-content: center;
}

.date-search-button button {
    width: 50%;
    height: 30px;
    padding: 2px;
    font-size: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 8px;
}

/* Force horizontal layout on all screens */
@media (max-width: 767px) {
    .date-input-group {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
    }
    
    .date-input-wrapper {
        min-width: calc(50% - 5px) !important;
    }
}

/* Very small screens adjustment */
@media (max-width: 400px) {
    .date-input-group {
        gap: 5px !important;
    }
    
    .date-input-wrapper {
        min-width: calc(50% - 3px) !important;
    }
    
    .date-input-wrapper input {
        font-size: 13px;
        padding: 6px 4px 4px 4px;
    }
}

.keyword-search-container {
    display: flex;
    justify-content: center;
    margin: 10px 0;
}

.keyword-search-wrapper {
    width: 90%;
    position: relative;
    color: white;
}

.keyword-search-wrapper input {
    width: 100%;
    height: 36px;
    font-size: 16px;
    color: white;
    padding: 5px;
}

button {
    min-width: 150px;
    padding: 10px 20px;
}

/* Button styles */
button[type="button"] {
    transition: all 0.1s ease;
    background-color: #4CAF50;
    color: white;
}

button:active {
    transform: scale(0.98);
    transition: all 0.1s ease;
}

button[type="submit"]:active {
    background-color: lightgreen !important;
}

button[type="button"]:active {
    background-color: #ffcccc !important;
}

.search-buttons {
    width: 100%;
    justify-content: center;
    display: flex;
    gap: 5px;
    justify-content: center;
    flex-wrap: wrap;
    text-align:center:
}

.search-buttons:hover {
    border: 2px solid red;
}

/* Dropdown search styles */
.search-toggle-btn {
  padding: 10px 16px;
  background:  #2E7D32;
  color: #ffffff;
  border:  2px solid #555;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  margin-bottom: 10px;
  transition: background 0.2s ease;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.search-toggle-btn:hover {
    background: #45a049;
    border: 2px solid red;
}

.search-dropdown {
    max-width: 980px;
    margin: 5px auto;
    display: none;
    position: relative;
    background-color: #66ffcc;
    min-width: 250px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
    padding: 12px;
    z-index: 1;
    border-radius: 4px;
    margin: 5px auto;
    max-width: 600px;
    color: #e0e0e0;
}

.search-dropdown.active {
    display: block;
}

/* Mobile styles for dropdown */
@media (max-width: 767px) {
    .form-container {
        max-width: 100%;
        padding: 10px;
        font-size: 14px;
    }
    
    .date-input-wrapper input,
    #county, #town, #venue, #general_search {
        height: 40px !important;
        font-size: 16px !important;
        padding: 8px 10px !important;
    }
    
    .date-input-wrapper label {
        font-size: 14px;
        top: -10px;
    }
    
    fieldset > div {
        flex-direction: column;
    }

    .form-group {
        flex-direction: column;
    }

    form input, form select {
        height: 32px;
        font-size: 12px;
        padding: 5px;
    }

    button[type="button"] {
        width: 100%;
    }

    .search-toggle-btn {
        width: 90%;
        padding: 10px;
        font-size: 14px;
    }
    
    .search-toggle-btn:hover {
        background-color: #45a049;
        border: 2px solid red;
    }

    .search-dropdown {
        width: 90%;
        padding: 8px;
    }
}