body {
    background-color: #f4eee8;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.calendar-container {
    max-width: 100%;
    margin: 10px auto;
    padding: 0 10px;
    font-family: Arial, sans-serif;
    background: white;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .calendar-container {
        max-width: 800px;
    }
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px;
    background-color: white;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.calendar-header button {
    padding: 6px 12px;
    cursor: pointer;
    border: 2px solid #d04848;
    background: white;
    color: #d04848;
    border-radius: 4px;
    font-size: 14px;
}

.calendar-header button:hover {
    background: #d04848;
    color: white;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    background-color: white;
    padding: 4px 0;
    color: #222;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 12px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 0 0 8px 8px;
    position: relative;
}

.calendar-day {
    min-height: 60px;
    padding: 4px;
    background-color: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    font-size: 11px;
}

.calendar-day.other-month {
    background-color: #f8f6f4;
    color: #999;
}

.event {
    margin: 1px 0;
    padding: 3px 6px;
    background-color: #d04848;
    color: white;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.event.expanded {
    position: absolute;
    background-color: #d04848;
    margin: 0;
    padding: 8px;
    width: 200%;
    z-index: 2;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: none;
    color: white;
}

.calendar-day:nth-child(7n) .event.expanded {
    right: 0;
    width: 200%;
    transform: translateX(-50%);
}

.calendar-day:nth-child(6n) .event.expanded {
    right: 0;
    width: 200%;
    transform: translateX(-50%);
}

.event-details {
    display: none;
    background-color: white;
    margin-top: 4px;
    padding: 8px;
    border-radius: 3px;
    font-size: 11px;
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.event-details.show {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.event-details p {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.event-details-label {
    font-weight: bold;
    color: #d04848;
    margin-bottom: 2px;
}

.event-time {
    color: #222;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 8px;
}

.event-time .time-section {
    display: flex;
    align-items: center;
    gap: 4px;
}

.event-location { 
    color: #222;
    display: flex;
    align-items: center;
    gap: 4px;
}

.event-people { 
    color: #222;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.event-description {
    white-space: pre-line;
    line-height: 1.4;
    color: #222;
}

@media (max-width: 768px) {
    .view-toggle,
    .desktop-view {
        display: none !important;
    }

    .mobile-view {
        display: flex !important;
    }

    .calendar-container {
        margin: 5px;
        padding: 5px;
    }

    .calendar-header {
        padding: 4px;
    }

    .calendar-header button {
        padding: 4px 8px;
        font-size: 12px;
    }

    #monthYear {
        font-size: 14px;
    }

    .weekdays {
        padding: 3px 0;
        font-size: 11px;
    }

    .calendar-grid {
        gap: 1px;
        padding: 4px;
    }

    .calendar-day {
        min-height: 50px;
        padding: 4px;
        font-size: 11px;
    }

    .event {
        padding: 3px 6px;
        font-size: 11px;
    }

    .event.expanded {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 300px;
        max-height: 80vh;
        overflow-y: auto;
        z-index: 1000;
        padding: 12px;
        margin: 0;
    }

    .event-details.show {
        padding: 8px;
        font-size: 12px;
        gap: 6px;
    }

    .event-time {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .calendar-link {
        font-size: 11px;
        align-self: flex-start;
    }

    .event-details p {
        gap: 4px;
    }

    .event-description {
        font-size: 11px;
        line-height: 1.3;
    }

    .event.expanded::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }

    .event-image {
        width: 72px;
        height: 72px;
    }

    .event-actions {
        gap: 16px;
    }

    .desktop-view {
        display: none;
    }

    .mobile-view {
        display: flex;
        flex-direction: column;
        height: 90vh;
        padding: 16px;
        background: #f4eee8;
    }

    .mobile-header {
        color: #d04848;
        border-radius: 12px;
        padding: 16px;
        text-align: center;
        font-size: 22px;
        font-weight: 600;
        margin-bottom: 16px;
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
        letter-spacing: 0.5px;
        border: none;
        position: relative;
    }

    .mobile-header .participant-count {
        position: absolute;
        top: -10px;
        right: -10px;
        background: #FFD700;
        color: #333;
        border-radius: 50%;
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        font-weight: bold;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .mobile-cards-container {
        flex: 1;
        position: relative;
        overflow: hidden;
    }

    .mobile-cards {
        height: 100%;
        position: relative;
        touch-action: pan-x;
    }

    .mobile-card {
        position: absolute;
        height: 70vh;
        background: white;
        border: 1px solid #b83b3b;
        border-radius: 12px;
        padding: 20px;
        display: grid;
        grid-template-areas: 
            "image title"
            "image time"
            "location location"
            "description description"
            "calendar calendar";
        grid-template-columns: 120px 1fr;
        grid-template-rows: auto auto auto 1fr auto;
        gap: 16px;
        transition: transform 0.3s ease;
        opacity: 0;
        pointer-events: none;
    }

    .mobile-card.active {
        opacity: 1;
        pointer-events: all;
        transform: translateX(0);
    }

    .mobile-card.prev {
        transform: translateX(-100%);
    }

    .mobile-card.next {
        transform: translateX(100%);
    }

    .mobile-card-image {
        grid-area: image;
        width: 120px;
        height: 120px;
        object-fit: cover;
        border-radius: 8px;
    }

    .mobile-card-title {
        grid-area: title;
        font-size: 22px;
        font-weight: bold;
        color: #d04848;
    }

    .mobile-card-time {
        grid-area: time;
        font-size: 22px;
        color: #666;
    }

    .mobile-card-location {
        grid-area: location;
        font-size: 20px;
        padding: 12px 0;
        border-top: 1px solid rgba(0,0,0,0.1);
        border-bottom: 1px solid rgba(0,0,0,0.1);
    }

    .mobile-card-description {
        grid-area: description;
        font-size: 20px;
        line-height: 1.4;
        color: #444;
    }

    .mobile-card .calendar-actions {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-card .calendar-link {
        flex: 1;
        width: auto;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        background: #4CAF50;
        color: white;
        text-decoration: none;
        padding: 12px 24px;
        border-radius: 6px;
        font-size: 20px;
        text-align: center;
        margin: 0;
    }

    .view-toggle {
        display: none;
    }

    .cards-container {
        padding: 10px;
    }

    .event-card {
        min-height: 300px;
    }
}

@media (max-width: 480px) {
    .calendar-container {
        margin: 5px;
        padding: 5px;
    }

    .calendar-day {
        min-height: 50px;
    }

    .event.expanded {
        width: 95%;
        padding: 10px;
    }
}

.location-link {
    display: inline-flex;
    align-items: center;
    color: #d04848;
    text-decoration: none;
    transition: color 0.2s ease;
    gap: 4px;
}

.location-link:hover {
    color: #b83b3b;
    text-decoration: underline;
}

.map-icon {
    display: none;
}

.event-location {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.calendar-link {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9em;
    gap: 4px;
    background-color: #4CAF50;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.calendar-link:hover {
    background-color: #388E3C;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.greeting {
    text-align: center;
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

.wave {
    display: inline-block;
    animation: wave 2.5s infinite;
    transform-origin: 70% 70%;
}

@keyframes wave {
    0% { transform: rotate(0deg); }
    10% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); }
    30% { transform: rotate(14deg); }
    40% { transform: rotate(-4deg); }
    50% { transform: rotate(10deg); }
    60% { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

.event-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 8px;
}

.event-image {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    margin-left: -8px;
}

.modal {
    display: none;
    position: fixed;
    z-index: -1;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.modal-content {
    position: fixed;
    left: -9999px;
    top: -9999px;
    width: 0;
    height: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
}

.modal, .modal-content {
    transition: none;
    animation: none;
}

#monthYear {
    font-size: 16px;
}

/* Common styles for the plus button */
.plus-button {
    display: none;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #4CAF50;
    color: white;
    border-radius: 6px;
    font-size: 18px;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

.plus-button:hover {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Mobile specific styles */
.mobile-card .plus-button {
    width: 50.5px;
    height: 50.5px;
    font-size: 22px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    padding: 0;
}

.mobile-card .plus-button:hover {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.calendar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
}

.mobile-card .calendar-actions {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-card .calendar-link {
    flex: 1;
    width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #4CAF50;
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 20px;
    text-align: center;
    margin: 0;
}

/* Hide all participant counts */
.participant-count {
    display: none !important;  /* Use !important to override any existing styles */
}

.mobile-card .participant-count,
.event .participant-count,
.mobile-header .participant-count,
.event-card .participant-count {
    display: none !important;
}

.view-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    background: white;
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 100;
}

.view-toggle-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #f4eee8;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-toggle-btn.active {
    background: #d04848;
    color: white;
}

.cards-container {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
    background: #f4eee8;
}

.cards-container.active {
    display: grid;
}

.event-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    min-height: 400px;
    overflow: hidden;
}

.background-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.8;
    z-index: 0;
}

.event-card-header {
    display: flex;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.event-card-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
}

.event-card-title {
    font-size: 16px;
    font-weight: bold;
    color: #d04848;
    margin-bottom: 4px;
    display: inline-block;
    background-color: white;
    border-radius: 8px;
    padding: 8px;
    margin: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-card-time {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
    border-bottom: 1px solid #dcdcdc;
}

.event-card-description {
    font-size: 12px;
    line-height: 1.4;
    color: #444;
    max-width: 100%;
    max-height: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 1;
    margin-bottom: 10px;
}

.event-card-description p {
    margin: 0 0 8px 0;
}

.event-card-description strong {
    color: #333;
}

.event-card-description em {
    font-style: italic;
}

.event-card-description ul, 
.event-card-description ol {
    margin: 8px 0;
    padding-left: 20px;
}

.event-card-description li {
    margin-bottom: 4px;
}

.event-card-description a {
    color: #d04848;
    text-decoration: none;
}

.event-card-description a:hover {
    text-decoration: underline;
}

.event-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.event-tag {
    background: #f4eee8;
    color: #666;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    line-height: 1.2;
}

.event-references {
    padding-top: 12px;
    padding-bottom: 60px;
}

.event-references h4 {
    color: #666;
    margin-bottom: 12px;
    font-size: 14px;
}

.event-references ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 12px;
    color: #444;
    line-height: 1.5;
}

.event-references li {
    margin-bottom: 10px;
    line-height: 1.4;
    padding-left: 20px;
    position: relative;
}

.event-references li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #d04848;
}

/* Add specific font-family to cards if needed */
.event-card,
.event-card-title,
.event-card-time,
.event-card-description,
.event-tag,
.event-references {
    font-family: inherit;  /* Ensure font inheritance */
}

.event-references li{
    text-shadow: 0.5px 0.5px black;
}

.event-card-time,
.event-card-description{
    text-shadow: 0.5px 0.5px black;
}

/* Update calendar actions positioning */
.event-card .calendar-actions {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: auto;  /* Override previous width: 100% */
    margin-top: auto;
    padding: 4px;
    border-radius: 6px;
}

/* Ensure content fills available space */
.event-card > *:not(.calendar-actions) {
    flex: 0 0 auto;
}

.cards-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    justify-content: center;
    padding: 20px 0;
}

.tab-btn {
    padding: 10px 24px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: #f4eee8;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 500;
    min-width: 140px;
    text-align: center;
}

.tab-btn:hover {
    background: #e9e3dd;
    transform: translateY(-1px);
}

.tab-btn.active {
    background: #d04848;
    color: white;
    border: 2px solid #b83b3b;
    box-shadow: 0 2px 8px rgba(208, 72, 72, 0.2);
}

.cards-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.past-event {
    background-color: rgba(211, 211, 211, 0.5); /* Light gray background */
    color: rgba(0, 0, 0, 0.5); /* Darker text color for contrast */
    opacity: 0.7; /* Slightly faded effect */
    pointer-events: none; /* Disable interactions */
}

.past-event .calendar-actions {
    display: none; /* Hide calendar actions for past events */
}

.past-title {
    color: rgba(0, 0, 0, 0.5); /* Grey color for past titles */
}

.past-image {
    filter: grayscale(100%); /* Make past images grey */
    opacity: 0.7; /* Slightly faded effect */
}

footer {
    text-align: center;
    padding: 10px;
    background-color: #f4eee8;
    position: fixed;
    bottom: 0;
    width: 100%;
}

footer p {
    margin: 0;
    color: #666;
} 

hr {
    display: block;
    height: 1px;
    border: 0;
    border-top: 2px solid lightgrey;
    margin: 1em 0;
    padding: 0;
}

.event-card-location {
    padding: 4px; /* Add padding */
    margin-top: 2px; /* Add some space above the location */
    font-size: 12px; /* Adjust font size if needed */
    text-align: left; /* Align text to the left */
}

.event-card-location a {
    color: white; /* Link color */
    text-decoration: none; /* Remove underline */
    text-shadow: 0.5px 0.5px black;
}

.event-card-location a:hover {
    text-decoration: underline; /* Underline on hover */
}

.event-card-price {
    font-size: 12px; /* Adjust font size */
    color: white; /* Text color */
    margin-top: 4px; /* Space above the price */
    display: flex; /* Flexbox for alignment */
    align-items: center; /* Center vertically */
    text-shadow: 0.5px 0.5px black;
}