/**
 * Planning Center Events Widget Styling
 */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css');

.pc-events-container {
    /* Core variables */
    --pc-text-color: inherit;
    --pc-text-muted: inherit;
    --pc-border-radius: 16px;

    background-color: transparent;
    padding: 20px;
    border-radius: var(--pc-border-radius);
    height: auto !important;
    min-height: min-content;
}

/* Force Elementor widget wrapper to respect dynamic event height instead of overlapping footer */
.elementor-widget-planning_center_events,
.elementor-widget-planning_center_events .elementor-widget-container,
.e-con:has(.elementor-widget-planning_center_events),
.e-con-inner:has(.elementor-widget-planning_center_events) {
    height: auto !important;
    min-height: min-content !important;
    display: block !important;
}

.pc-events-header {
    color: var(--pc-text-color);
    font-family: inherit;
    font-weight: 700;
    margin-bottom: 30px;
    font-size: 24px;
}

.pc-events-grid {
    display: grid;
    gap: 30px;
}

/* Mobile: Force 1 column */
@media (max-width: 767px) {
    .pc-events-grid {
        grid-template-columns: 1fr !important;
    }
}

.pc-event-card {
    display: flex;
    flex-direction: column;
    padding: 12px;
    border-radius: var(--pc-border-radius);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    text-decoration: none;
    color: var(--pc-text-color);
}

.pc-event-card:hover {
    transform: translateY(-8px);
    background-color: rgba(128, 128, 128, 0.05);
}

.pc-event-image-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: var(--pc-border-radius);
    background-color: rgba(128, 128, 128, 0.1);
}

.pc-event-image-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.pc-event-card:hover .pc-event-image-wrap img {
    transform: scale(1.1);
}

.pc-event-title {
    color: var(--pc-text-color);
    font-weight: 700;
    font-size: 16px;
    margin: 0 0 5px 0;
    line-height: 1.3;
}

.pc-event-location-main {
    color: var(--pc-text-color);
    font-size: 12px;
    margin-bottom: 12px;
    opacity: 0.8;
}

.pc-event-meta {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pc-event-meta li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--pc-text-color);
    font-size: 12px;
    margin-bottom: 6px;
    opacity: 0.7;
}

.pc-event-meta li i {
    width: 14px;
    text-align: center;
    font-size: 0.9em;
}

.pc-event-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ef4444;
    color: #fff;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 2;
}

/* --- Modal Styles --- */
.pc-modal,
.pc-modal * {
    box-sizing: border-box;
}

.pc-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    /* For iOS Safari address bar handling */
    z-index: 100000;
    /* Increased to stay above Elementor headers */
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pc-modal.is-active {
    display: flex !important;
}

.pc-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.pc-modal-container {
    position: relative;
    background: #000;
    /* True black background for modal contents as per image */
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    max-height: 90dvh;
    /* For better mobile scaling */
    /* For better mobile scaling */
    border-radius: var(--pc-modal-radius, 20px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
    box-shadow: 0 30px 60px rgba(0, 0, 0, 1);
    color: #fff;
    z-index: 1;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Hide scrollbar */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.pc-modal-container::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari/Opera */
}

.pc-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 36px;
    line-height: 1;
    padding: 10px;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s, opacity 0.2s;
    opacity: 0.8;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.pc-modal-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

.pc-modal-header-image {
    position: relative;
    width: 100%;
    height: 400px;
}

.pc-modal-header-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(to bottom, transparent, #000);
    z-index: 2;
}

.pc-modal-header-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pc-modal-body {
    padding: 60px;
}

.pc-modal-main-info {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 60px;
}

.pc-modal-description {
    font-size: 18px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
    word-break: break-word;
    /* Prevent long strings from causing horizontal overflow */
}

.pc-modal-event-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 25px;
    color: #fff;
    line-height: 1.2;
    word-break: break-word;
    /* Prevent long titles from causing horizontal overflow */
}

.pc-modal-description h1,
.pc-modal-description h2,
.pc-modal-description h3 {
    color: #fff;
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 700;
}

/* Sidebar Details Card (Matching Image) */
.pc-modal-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.pc-modal-details-card {
    background: #222;
    /* Dark card background */
    padding: 30px;
    border-radius: var(--pc-modal-radius, 20px);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.pc-modal-detail-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.pc-modal-detail-icon {
    width: 20px;
    margin-top: 3px;
    opacity: 0.8;
}

.pc-modal-detail-content {
    flex: 1;
}

.pc-modal-detail-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px;
    display: block;
}

.pc-modal-detail-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

.pc-modal-detail-actions {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.pc-modal-action-btn {
    background: none;
    border: none;
    color: #fff;
    padding: 0;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 0.8;
    text-decoration: none;
    transition: opacity 0.2s;
}

.pc-modal-action-btn:hover {
    opacity: 1;
}

.pc-modal-action-btn i {
    font-size: 16px;
}

/* Modal Primary Button */
.pc-btn-modal {
    background: #fff;
    color: #000;
    width: 100%;
    padding: 16px;
    border-radius: var(--pc-btn-radius, 40px);
    font-weight: 700;
    font-size: 16px;
    text-align: center;
    text-decoration: none;
    display: block;
    margin-top: 10px;
    transition: background 0.2s;
}

.pc-btn-modal:hover {
    background: #e0e0e0;
}

@media (max-width: 900px) {
    .pc-modal-main-info {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .pc-modal-body {
        padding: 30px 20px;
    }

    .pc-modal-header-image {
        height: 250px;
    }
}

@media (max-width: 600px) {
    .pc-modal {
        padding: 10px;
    }

    .pc-modal-container {
        max-height: 95vh;
        max-height: 95dvh;
        border-radius: var(--pc-modal-radius, 15px);
    }

    .pc-modal-event-title {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .pc-modal-body {
        padding: 20px 15px;
    }

    .pc-modal-details-card {
        padding: 20px;
        border-radius: var(--pc-modal-radius, 15px);
    }

    .pc-modal-description {
        font-size: 16px;
    }

    .pc-modal-close {
        top: 10px;
        right: 10px;
        font-size: 28px;
        padding: 10px;
    }
}

/* --- Light Theme Overrides --- */
.pc-theme-light .pc-event-card {
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #eaeaea;
}

.pc-theme-light .pc-event-card:hover {
    background-color: #f9f9f9;
}

.pc-theme-light {
    --pc-text-color: #111;
}

/* Light Theme Modal Overrides */
.pc-theme-light.pc-modal .pc-modal-container {
    background: #fff;
    color: #111;
}

.pc-theme-light.pc-modal .pc-modal-header-image::after {
    background: linear-gradient(to bottom, transparent, #fff);
}

.pc-theme-light.pc-modal .pc-modal-description h1,
.pc-theme-light.pc-modal .pc-modal-description h2,
.pc-theme-light.pc-modal .pc-modal-description h3,
.pc-theme-light.pc-modal .pc-modal-event-title {
    color: #000;
}

.pc-theme-light.pc-modal .pc-modal-description {
    color: #333;
}

.pc-theme-light.pc-modal .pc-modal-details-card {
    background: #f7f7f7;
    border: 1px solid #eee;
}

.pc-theme-light.pc-modal .pc-modal-detail-title {
    color: #000;
}

.pc-theme-light.pc-modal .pc-modal-detail-text,
.pc-theme-light.pc-modal .pc-modal-detail-icon {
    color: #555;
}

.pc-theme-light.pc-modal .pc-modal-action-btn {
    color: #333;
}

.pc-theme-light.pc-modal .pc-modal-close {
    color: #fff;
}

.pc-theme-light.pc-modal .pc-btn-modal {
    background: #000;
    color: #fff;
}

.pc-theme-light.pc-modal .pc-btn-modal:hover {
    background: #333;
}