.calendar-event-wrapper, .calendar-event-list-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 20px;
}

/* Header Styling */
.calendar-event-header {
    color: var(--global-color-0);
    background: var(--global-color-7);
    width: 100%;
    padding: 20px;
    border-top: solid var(--global-color-0);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Top Header: Back Button + View Count */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    width: 100%;
}

.back-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.back-container a {
    color: var(--global-color-0);
    text-decoration: none;
}

.views-count {
    font-weight: bold;
}

/* Event Details Grid */
.event-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 10px;
    width: var(--document-width);
}

.event-details div {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px;
    border-radius: 5px;
    display:flex;
    gap:10px;
}

/* Style for property names and values */
.event-details strong {
    color: var(--global-color-0); /* Property Name */
}

.event-details span {
    color: black; /* Property Value */
    font-weight: bold;
}

.event-details a {
    color: black;
    font-weight: bold;
    text-decoration: none; /* Remove default underline */
}

.event-details a:hover {
    text-decoration: underline; /* Add underline on hover for visual feedback */
}

/* Add line breaks between property name and value */
.event-details div strong::after {
    content: "\A";
    white-space: pre;
}




/* Content Section */
.calendar-event-content {
    width: var(--document-width);
    padding: 20px;
}

.calendar-event-content h1 {
    color: var(--global-color-0);
    font-size: 1.7em;
    margin-bottom: 25px;
}

/* calendar */
.main-container {
    display: flex;
    justify-content: space-between; /* Create space between calendar and content */
    gap: 20px;
    width: var(--document-width);
    
}

.calendar-container {
    flex: 1; /* Take up 1 part of the space */
    min-width: 300px; /* Prevent it from getting too small */
}

.content-container {
    flex: 2; /* Take up 2 parts of the space */
    min-width: 400px; /* Set minimum size for the content area */
    padding: 20px 0px;
}

.event-item {
    display: flex;
    flex-direction: column;
    min-height: 130px;
    background-color: #f9f9f9;
    border-radius: 6px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor:pointer;
    position:relative;
    transition: box-shadow 0.2s ease-in-out;
}

.event-item:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.event-item:not(:last-child) {
    margin-bottom: 20px;
}

.event-date p {
    color: var(--global-color-8);
    font-size: 0.8em;
}

.event-item .event-title {
    margin: auto 0px;
}

.event-item .event-geolocation {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    align-items: center;
    border-top: solid var(--global-color-0) 1px;
    padding-top: 10px;
}

.event-item .event-geolocation p {
    margin: 0px;
}

.event-title p {
    font-size: 1em;
    font-weight: bold;
    color: var(--global-color-0);
}

.event-type {
    padding: 5px 10px;
    color: var(--global-color-6);
    background-color: var(--global-color-0);
    /* text-align: end; */
    font-size: 0.8em;
    text-transform: uppercase;
}

.event-type:not(:first-child) {
    margin-top: 5px;
}

.event-type-wrapper {
    position: absolute;
    top: 10px;
    right: 0px;
}


/* Wrapper for Calendar */
#calendar-container {
    width: 100%;
    max-width: 100%;
    padding: 10px;
    box-sizing: border-box;
    position: relative;
    display: flex;
    justify-content: center;
}

/* General Calendar Container */
.calendar {
    width: 100%;
    font-family: Arial, sans-serif;
    font-size: 14px;
    box-sizing: border-box;
}

.calendar:not(.alt) {
    height: 100%;
}

/* Calendar Header (Month and Year Selector) */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-direction: column;
    position:relative;
}

/* Selected Day (Month and Year) */
.calendar-selected-day {
    font-size: 18px;
    font-weight: bold;
    color: var(--global-color-0);
}

/* Dropdowns for Year and Month */
.calendar-filter {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    width:100%;
}

.calendar-filter  .calendar-filter-fields {
    display: flex;
    gap: 10px;
    align-items: center;
    width:100%;
}

/* Days of the Week Row */
.calendar-days {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

/* Each day in the week (flexbox for alignment) */
.calendar-days span {
    flex-basis: calc(14.2857% - 10px);  /* 14.2857% (1/7) of the row width minus the gap */
    text-align: center;
    font-weight: bold;
}

/* Calendar Rows (Week Containers) */
.calendar-rows {
    display: flex;
    flex-direction: column;
}

/* Each row of the calendar (week) */
.calendar-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

/* Calendar Cells (Days) */
.calendar-cell {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-basis: calc(14.2857% - 10px);  /* Same as days of the week, for alignment */
    height: calc(14.2857% - 10px);  /* Ensures the cell height matches the width for square shape */
    position: relative;
    box-sizing: border-box;
    border-radius: 50%;
    aspect-ratio: 1;
    transition: background-color 0.3s, font-weight 0.3s;
}

.calendar-cell:not(:empty):hover {
    background-color: #e7f8ff;
    cursor: pointer;
}

.calendar-cell:not(:empty):hover .date {
    font-weight: bold;
}

.calendar-cell.selected {
    background-color: var(--global-color-0) !important; /* Highlight for today */
}

.calendar-cell.selected .date {
    color:var(--global-color-6) !important;
    font-weight: bold !important;
}

.calendar-cell.past-event {
    background-color: #ff5c5c1f; /* For past events */
}

.calendar-cell.future-event {
    background-color: #009bdb29; /* For future events */
}

.calendar-cell.today-event {
    background-color: #28db0029; /* For future events */
}

.calendar-cell.today {
    border: solid var(--global-color-0) 2px !important;
}

.calendar-cell .date {
    font-size: 16px;
}

/* Event Marker */
.event-marker {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: red;
    color: white;
    border-radius: 50%;
    width: 10px;
    height: 10px;
    font-size: 10px;
    text-align: center;
    line-height: 10px;
}

/* Empty cells (non-used days) */
.calendar-cell.empty {
    background-color: transparent;
}


/* LIST */
.calendar-event-list-wrapper > h1 {
    width: 100%;
    text-align:center;
    background-color: var(--global-color-0);
    color: var(--global-color-7);
    padding: 20px 0px;
    font-size: 1.3em;
}

.calendar-event-list-wrapper .category-list {
    margin-bottom: 10px;
    color: var(--global-color-0);
}

.calendar-event-list-wrapper .calendar-category-wrapper {
    list-style-type: none;
    padding: 0px;
}

.calendar-event-list-wrapper .calendar-category-wrapper .calendar-category {
    cursor:pointer;
    /* margin-bottom: 10px; */
    padding:10px;
    transition: background-color 0.3s ease-in-out;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.calendar-event-list-wrapper .calendar-category-wrapper .calendar-category:hover {
    background-color: rgb(0 155 219 / 10%)
}
.calendar-event-list-wrapper .calendar-category-wrapper .calendar-category.selected {
    background-color: rgb(0 155 219 / 10%)
}

.event-grid-box {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.event-grid-box.categorised {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
}

.event-grid-box .header {
    padding-top: 50px;
    background-color: rgb(0 155 219 / 10%);
    padding-bottom: 30px;
    padding-left: 30px;
}

.event-grid-box .header p {
    font-size: .8em;
    color: var(--global-color-8);
    font-weight: normal !important;
    text-transform: uppercase;
    margin: 0;
    letter-spacing: 4px;
}

.event-grid-box .content {
    padding-top: 20px;
}

.event-grid-box.categorised .content {
    padding-top: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.event-grid-box .content .event-list-item {
    background-color: #f9f9f9;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    min-height: 120px;
    margin-bottom:20px;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    cursor: pointer;
    position:relative;
}

.event-grid-box.categorised .content .event-list-item {
    margin-bottom:0px !important;
}

.event-list-item .list-item-left-col {
    width: 30%;
    min-width: 30%;
}
.event-list-item .list-item-left-col img {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: cover;
}

.event-list-item .list-item-right-col {
    flex-grow: 1;
    padding: 10px;
    position:relative;
}

.calendar-header > .toggle-calendar-filter {
    position: absolute;
    left: 0px;
    top: 15px;
    display:none;
}

.calendar-event-title h1 {
    margin-bottom: 20px;
    width: var(--document-width);
}

.no-events {
    text-align: center;
    font-size: 1.5em;
}

/* GEOLOCATION */
#geo-map-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.geo-map-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    height: 500px;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
}

.geo-map-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: #f00;
    color: #fff;
    font-size: 20px;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-event-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--global-color-7);
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: solid var(--global-color-0) 2px;
    color: var(--global-color-0);
    box-shadow: 0px 0px 10px #dee2e6;
}

.calendar-event-count.alt {
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    font-size: 0.8em;
}

.past-event .calendar-event-count {
    border: solid #fa9b9b 2px;
    color: #fa9b9b;
}

.future-event .calendar-event-count {
    border: solid #96e0fd 2px;
    color: #64d3ff;
}


@media(max-width: 1200px) {
    .toggle-calendar-filter {
        display:block !important;
        padding: 10px 15px !important; 
    }

    .calendar-event-list-wrapper .left-col {
        display: none;
        position: fixed;
        top:0px;
        right:0px;
        background-color: var(--document-color);
        z-index: 100;
        box-shadow: 0px 0px 10px grey;
        height: 100%;
        overflow-y: scroll;
        overflow-x: hidden;
        scrollbar-width: none;         /* Firefox */
        -ms-overflow-style: none;      /* IE 10+ */
        width: 300px !important;
    }
    .calendar-event-list-wrapper .left-col::-webkit-scrollbar {
        display: none;                 /* Chrome, Safari */
    }

    .calendar-event-list-wrapper .right-col {
        width: 100% !important;
    }

    .calendar-selected-day {
        margin-top: 20px;
    }

    .event-details {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width: 991px) {
    .event-grid-box {
        grid-template-columns: repeat(1, 1fr);
    }
    .event-grid-box.categorised .content {
        grid-template-columns: repeat(1, 1fr);
    }
    .calendar-event-title h1 {
        font-size: 2em;
    }
}

@media(max-width: 790px) {
    .calendar-event-title h1 {
        font-size: 1.5em;
    }
}

@media(max-width: 767px) {
    .calendar-event-list-wrapper .left-col {
        width: 100% !important;
    }

    #calendar-container .main-container {
        flex-direction: column;
        width: 100%;
        margin: 0px;
    }
    #calendar-container .calendar-container {
        padding: 20px;
    }
    #calendar-container .content-container {
        padding: 0px;
        min-width: 100%;
    }

    .event-item {
        min-height: 130px !important;
    }
    .calendar-event-content h1 {
        font-size: 1.5em;
    }

    .event-title {
        margin-bottom: 0px !important;
    }
    .event-title p {
        font-size: 1em;
    }
    .event-type p {
        font-size: 0.8em;
    }

    .calendar-event-title h1 {
        text-align: center;
    }

    .event-details {
        grid-template-columns: repeat(1, 1fr);
    }
    
    .event-details div {
        flex-direction: column;
        gap:0px;
    }

    .calendar-event-count,
    .calendar-event-count.alt {
        top: -5px;
        right: -5px;
        width: 35px;
        height: 35px;
        font-size: 1em;
    }
}

@media(max-width: 600px) {
    .calendar-event-count,
    .calendar-event-count.alt {
        width: 30px;
        height: 30px;
    }
}

@media(max-width: 500px) {
    .calendar-event-count,
    .calendar-event-count.alt {
        width: 25px;
        height: 25px;
    }
}

@media(max-width: 425px) {
    .calendar-event-count,
    .calendar-event-count.alt {
        top: -8px;
        right: -8px;
        width: 23px;
        height: 23px;
        font-size: 0.8em;
    }
}

@media(max-width: 375px) {
    .calendar-event-count,
    .calendar-event-count.alt {
        width: 20px;
        height: 20px;
        font-size: 0.7em;
    }
}