/*
Plugin Name: SkånePlus Evenemangssystem
Description: Huvudstilfil för SkånePlus Evenemangssystem.
Version: 16.2.5
*/

/* Generella stilar för evenemangslistan (om den används via standard WordPress-loop) */
.skaneplus-events-list-block { /* This block might not be used directly anymore for frontend list, but keeping it for consistency if other blocks use it */
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-family: "Inter", sans-serif;
    color: #333;
}

.skaneplus-events-list-block h3 {
    color: #2271b1; /* WordPress primary blue */
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.8em;
    font-weight: 600;
}

.skaneplus-events-list-block p {
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 10px;
}

/* Stilar för platserlistan */
.skaneplus-venues-list-block {
    background-color: #fefefe;
    border: 1px solid #dcdcdc;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    font-family: "Inter", sans-serif;
    color: #333;
}

.skaneplus-venues-list-block h3 {
    color: #28a745; /* Green for venues */
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.8em;
    font-weight: 600;
}

/* Stilar för platskarta */
.wp-block-skaneplus-venue-map {
    border-radius: 10px;
    overflow: hidden; /* Klipper innehållet (kartan) till de runda hörnen */
    margin-bottom: 20px; /* Behåller marginalen */
}

/* Stilar för kartans popup-bubbla */
.leaflet-popup-content-wrapper {
    border-radius: 8px !important;
}

.leaflet-popup-content {
    margin: 13px 19px !important;
    font-family: "Inter", sans-serif;
}

.skaneplus-map-popup-logo {
    width: 100px;
    height: auto;
    display: block;
}


/* Stilar för platser efter kategori */
.skaneplus-venues-by-category-block {
    background-color: #fffaf0;
    border: 1px solid #ffe0b2;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-family: "Inter", sans-serif;
    color: #333;
}

.skaneplus-venues-by-category-block h3 {
    color: #ffc107; /* Orange/Yellow for categories */
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.8em;
    font-weight: 600;
}

/* Fältvisningsblock */
.wp-block-skaneplus-event-start-date,
.wp-block-skaneplus-event-end-date,
.wp-block-skaneplus-event-venue,
.wp-block-skaneplus-event-city,
.wp-block-skaneplus-venue-street-address,
.wp-block-skaneplus-venue-city,
.wp-block-skaneplus-venue-opening-hours {
    font-size: 1em;
    line-height: 1.6;
}

.wp-block-skaneplus-venue-opening-hours .sp-opening-hours-list,
.sp-opening-hours-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.wp-block-skaneplus-venue-opening-hours .sp-opening-hours-list li,
.sp-opening-hours-list li {
    margin-bottom: 4px;
}

.wp-block-skaneplus-venue-opening-hours .opening-hours-day,
.opening-hours-day {
    font-weight: bold;
}


.field-label {
    font-weight: bold;
    margin-right: 8px;
}

/* Stilar för anpassade knappar */
.wp-block-skaneplus-event-website-button .wp-block-button__link,
.wp-block-skaneplus-event-booking-button .wp-block-button__link,
.wp-block-skaneplus-event-program-button .wp-block-button__link,
.wp-block-skaneplus-venue-website-button .wp-block-button__link,
.wp-block-skaneplus-venue-phone-button .wp-block-button__link,
.wp-block-skaneplus-venue-email-button .wp-block-button__link,
.wp-block-skaneplus-venue-facebook-button .wp-block-button__link,
.wp-block-skaneplus-venue-instagram-button .wp-block-button__link,
.wp-block-skaneplus-venue-navigate-button .wp-block-button__link {
    padding: 5px 10px; /* 5px uppe/nere, 10px vänster/höger */
    height: auto; /* Låt innehållet styra höjden */
    line-height: normal; /* Återställ eventuell fast radhöjd */
    display: inline-flex; /* För att centrera ikon och text vertikalt */
    align-items: center;
}

/* Gemensam stil för alla ikoner i knapparna */
[class*="wp-block-skaneplus-"] .wp-block-button__link .sp-button-icon {
    margin-right: 0px;
}

/* Särskild storleksregel för SVG-ikoner för att matcha Dashicons */
[class*="wp-block-skaneplus-"] .wp-block-button__link .sp-button-icon--svg {
    width: 20px;
    height: 20px;
}


/* Stilar för Evenemang på Platsen-blocket */
.wp-block-skaneplus-events-at-venue {
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 0px;
}

.skaneplus-events-at-venue-title {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5em;
    color: #555555;
}

.skaneplus-events-at-venue-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.skaneplus-events-at-venue-list .skaneplus-event-date-header {
    font-weight: bold;
    margin-top: 1em;
    font-size: 1.1em;
    padding-bottom: 10px;
}
.skaneplus-events-at-venue-list .skaneplus-event-date-header:first-child {
    margin-top: 0;
}

.skaneplus-events-at-venue-list .skaneplus-event-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #ffffff;
    border-radius: 10px;
    margin-bottom: 5px;
}
.skaneplus-events-at-venue-list li:last-of-type {
    margin-bottom: 0;
}

.skaneplus-events-at-venue-list .skaneplus-event-time {
    flex-shrink: 0;
    margin-right: 4px !important;
    font-size: 0.9em;
    color: #555;
    width: 90px;
}

.skaneplus-events-at-venue-list .skaneplus-event-dot {
    flex-shrink: 0;
    width: 9px;
    height: 9px;
    background-color: #555555;
    border-radius: 50%;
    margin-right: 8px;
}

.skaneplus-events-at-venue-list .skaneplus-event-item a {
    font-weight: 600;
    text-decoration: none;
    color: #f98629 !important;
    transition: color 0.2s ease-in-out;
    font-size: 0.9em;
}

.skaneplus-events-at-venue-list .skaneplus-event-item a:hover {
    text-decoration: none;
    color: #555555 !important;
}

/*
 * FullCalendar Styles
 * ---------------------------------------------------------------------------------
 */
.wp-block-skaneplus-event-calendar {
    margin-top: 2em;
    margin-bottom: 2em;
}

#sp-event-calendar-container {
    /* Use CSS variables from the theme's color palette */
    --fc-border-color: var(--wp--preset--color--contrast-3, #ddd);
    --fc-today-bg-color: rgba(255, 224, 102, 0.3);
    --fc-page-bg-color: var(--wp--preset--color--base, #fff);
    --fc-list-event-hover-bg-color: transparent;
}

.fc .fc-header-toolbar.fc-toolbar {
    /* Add margin to the toolbar for spacing on all screen sizes */
    margin: 10px 10px 20px 10px;
}

.fc .fc-toolbar-title {
    font-size: 1.5em;
    font-weight: 600;
}

.fc .fc-button {
    box-sizing: border-box;
    text-transform: capitalize;
    border-radius: 10px;
    padding: 5px 10px;
    height: 34px; /* Adjusted height */
    line-height: normal;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: none;
    font-weight: bold;
    
    /* Custom button colors */
    background-color: #eeeeee;
    color: #f98629;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.fc .fc-button:hover,
.fc .fc-button-active {
    background-color: #f98629 !important;
    color: #ffffff !important;
    border: none !important;
}

.fc .fc-button:active {
    border: none !important;
}

.fc .fc-button:focus,
.fc .fc-button:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}


.fc .fc-prev-button,
.fc .fc-next-button {
    width: 34px; /* Match new height */
    padding: 5px;
}

.fc .fc-daygrid-day-number {
    padding: 0.5em;
}

/* Event styles for Month and Week views */
.fc-daygrid-event, .fc-timegrid-event {
    cursor: pointer;
    font-size: 0.85em;
    padding: 3px 5px;
    border-radius: 4px;
    background-color: #eeeeee !important;
    border: none !important;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.fc-daygrid-event .fc-event-title,
.fc-daygrid-event .fc-event-time,
.fc-timegrid-event .fc-event-title,
.fc-timegrid-event .fc-event-time {
    color: #f98629;
    transition: color 0.2s ease-in-out;
}

.fc-daygrid-event:hover, .fc-timegrid-event:hover {
    background-color: #f98629 !important;
}

.fc-daygrid-event:hover .fc-event-title,
.fc-daygrid-event:hover .fc-event-time,
.fc-timegrid-event:hover .fc-event-title,
.fc-timegrid-event:hover .fc-event-time {
    color: #ffffff;
}

/* Agenda/List view styles */
.fc-list-day-cushion {
    background-color: #f7f7f7;
}

.fc-list-day-cushion a {
    color: #555555 !important;
    cursor: default;
    text-decoration: none;
    /* The background is now transparent by default */
}

.fc-list-day-cushion:hover a {
     color: #555555 !important;
     /* The background will correctly be inherited from the hovered row */
}


.fc-list-event .fc-list-event-dot {
    border-color: #555555 !important;
    background-color: #555555 !important;
    border-width: 4px; /* Smaller dot */
}

.fc-list-event .fc-list-event-time {
    font-size: 0.9em; /* Smaller time font */
}

.fc-direction-ltr .fc-list-event-title a {
    color: #f98629;
    text-decoration: none !important;
    transition: color 0.2s ease-in-out;
    font-size: 0.9em; /* Smaller event title font */
}

.fc-direction-ltr .fc-list-event-title a:hover {
    color: #555555;
    text-decoration: none !important;
}

.fc-list-event:hover .fc-list-event-title a {
    color: #555555;
    text-decoration: none !important;
}

/* Holiday Event Styling */
.fc-event.sp-holiday-event {
    background-color: transparent !important;
    border: none !important;
    cursor: default !important;
}

.fc-event.sp-holiday-event .fc-event-title {
    color: #f98629 !important;
    font-weight: normal !important;
    font-style: italic;
}

.fc-list-event.sp-holiday-event {
    background-color: transparent !important;
}

.fc-list-event.sp-holiday-event:hover {
    background-color: transparent !important;
}

.fc-list-event.sp-holiday-event .fc-list-event-dot {
    border-color: #f98629 !important;
}

/*
 * Responsiva justeringar för kalendern
 * ---------------------------------------------------------------------------------
 */
@media (max-width: 768px) {
    .skaneplus-events-list-block,
    .skaneplus-venues-list-block,
    .wp-block-skaneplus-venue-map,
    .skaneplus-venues-by-category-block {
        padding: 15px;
    }

    .skaneplus-events-list-block h3,
    .skaneplus-venues-list-block h3,
    .skaneplus-venues-by-category-block h3 {
        font-size: 1.5em;
    }

    .fc .fc-header-toolbar.fc-toolbar {
        /* Stack the toolbar sections vertically on small screens */
        flex-direction: column;
        gap: 15px; /* Add some space between the stacked sections */
    }
    .fc .fc-toolbar-title {
        font-size: 1.2em;
    }
    .fc .fc-button {
        font-size: 0.9em;
    }
    
    /* Force the calendar view to not have a fixed height, preventing internal scroll */
    .fc .fc-view-harness {
        height: auto !important;
    }

    /* Ensure the list view doesn't create horizontal scroll */
    .fc-list {
        width: 100%;
        overflow: hidden;
    }
}
