/* Theme Variables */
:root {
    --cc-bg-wrapper: #191919;
    --cc-bg-sidebar: #111;
    --cc-text-main: #fff;
    --cc-text-muted: #aaa;
    --cc-text-faint: #888;
    --cc-border: #333;
    --cc-border-light: #222;
    --cc-hover: #222;
    --cc-accent: #ff6600;
    --cc-input-bg: #222;
    --cc-input-border: #444;
    --cc-card-bg: #222;
    --cc-card-hover: #2a2a2a;
    --cc-icon-color: "%23ffffff";
}

.theme-light {
    --cc-bg-wrapper: #f9f9f9;
    --cc-bg-sidebar: #ffffff;
    --cc-text-main: #222;
    --cc-text-muted: #555;
    --cc-text-faint: #777;
    --cc-border: #eee;
    --cc-border-light: #f0f0f0;
    --cc-hover: #f5f5f5;
    --cc-accent: #ff6600;
    --cc-input-bg: #fff;
    --cc-input-border: #ddd;
    --cc-card-bg: #f9f9f9;
    --cc-card-hover: #f0f0f0;
    --cc-icon-color: "%23222222";
}

/* Container styles */
.church-campus-widget-wrapper {
    display: flex;
    /* Height is now set dynamically by Elementor */
    width: 100%;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    font-family: 'Inter', 'Roboto', sans-serif;
    background-color: var(--cc-bg-wrapper);
}

/* Sidebar List */
.church-campus-list-container {
    width: 350px;
    background-color: var(--cc-bg-sidebar);
    color: var(--cc-text-main);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--cc-border);
}

.church-campus-list-header {
    padding: 20px;
    border-bottom: 1px solid var(--cc-border);
}

.church-campus-search {
    width: 100%;
    padding: 10px 15px 10px 40px !important;
    border-radius: 20px;
    border: 1px solid var(--cc-input-border);
    background-color: var(--cc-input-bg);
    color: var(--cc-text-main);
    font-size: 14px;
    margin-bottom: 15px;
    box-sizing: border-box;
    outline: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23999" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>');
    background-repeat: no-repeat;
    background-position: 12px center;
}

.church-campus-search:focus {
    border-color: var(--cc-accent);
}

/* List Items */
.church-campus-list-items {
    flex-grow: 1;
    overflow-y: auto;
}

.church-campus-list-items::-webkit-scrollbar {
    width: 6px;
}
.church-campus-list-items::-webkit-scrollbar-track {
    background: transparent;
}
.church-campus-list-items::-webkit-scrollbar-thumb {
    background: var(--cc-border);
    border-radius: 3px;
}

.church-campus-list-item {
    display: flex;
    padding: 20px;
    border-bottom: 1px solid var(--cc-border-light);
    cursor: pointer;
    transition: background-color 0.2s;
    justify-content: space-between;
}

.church-campus-list-item:hover, .church-campus-list-item.active {
    background-color: var(--cc-hover);
}

.church-campus-info {
    flex-grow: 1;
    padding-right: 15px;
}

.church-campus-title {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--cc-text-main);
}

.church-campus-address {
    margin: 0 0 10px 0;
    font-size: 12px;
    color: var(--cc-text-muted);
    line-height: 1.4;
}

.church-campus-meta {
    margin: 0;
    font-size: 11px;
    color: var(--cc-text-faint);
}

.church-campus-meta span {
    margin-right: 10px;
}

.church-campus-thumbnail {
    width: 80px;
    height: 60px;
    border-radius: 6px;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--cc-border);
}

.church-campus-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Map Container */
.church-campus-map-container {
    flex-grow: 1;
    height: 100%;
}

/* Responsive */
@media (max-width: 768px) {
    .church-campus-widget-wrapper {
        flex-direction: column;
        height: 100vh !important;
    }
    .church-campus-list-container {
        width: 100%;
        height: auto;
        flex: 1;
        border-right: none;
        border-bottom: 1px solid var(--cc-border);
    }
    .church-campus-map-container {
        height: 45vh;
        min-height: 250px;
    }
}

/* Detail Pane Sub-View */
.church-campus-list-container {
    position: relative; /* important for pane overlay */
}

.church-campus-detail-pane {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--cc-bg-wrapper);
    z-index: 10;
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.3s;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.church-campus-list-container.show-detail .church-campus-detail-pane {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s;
}

.church-campus-detail-pane::-webkit-scrollbar {
    width: 6px;
}
.church-campus-detail-pane::-webkit-scrollbar-track {
    background: transparent;
}
.church-campus-detail-pane::-webkit-scrollbar-thumb {
    background: var(--cc-border);
    border-radius: 3px;
}

.church-campus-detail-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    z-index: 15;
    transition: background 0.2s;
}

.church-campus-detail-close:hover {
    background: rgba(0,0,0,0.8);
}

.church-campus-detail-image {
    width: calc(100% - 30px);
    margin: 15px 15px 0 15px;
    height: 200px;
    background-color: var(--cc-border);
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.church-campus-detail-content {
    padding: 20px 20px 40px 20px;
}

.church-campus-detail-title {
    margin: 0 0 20px 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--cc-text-main);
    line-height: 1.2;
}

.church-campus-detail-directions, .church-campus-hover-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--cc-card-bg);
    border-radius: 8px;
    text-decoration: none;
    color: var(--cc-text-main);
    margin-bottom: 5px;
    transition: background 0.2s;
}
.church-campus-detail-directions:hover, .church-campus-hover-link:hover {
    background: var(--cc-card-hover);
}
.church-campus-detail-address {
    font-size: 13px;
    line-height: 1.4;
    color: var(--cc-text-muted);
}

.church-campus-detail-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid var(--cc-border-light);
    color: var(--cc-text-main);
}
.church-campus-detail-item:last-of-type {
    border-bottom: none;
}

.church-campus-detail-text {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.church-campus-detail-text strong {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}
.church-campus-detail-text span {
    font-size: 12px;
    color: var(--cc-text-faint);
}

/* Service Times List */
.church-campus-service-list {
    margin-top: 15px;
    width: 100%;
}

.church-campus-service-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px 0;
    border-bottom: 1px solid var(--cc-border-light);
    color: var(--cc-text-main);
}
.church-campus-service-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.church-campus-service-desc {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--cc-text-main);
    flex-grow: 1;
}

.church-campus-service-subtitle {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--cc-text-main);
    margin-top: 2px;
}

.church-campus-service-time {
    font-size: 15px;
    font-weight: 700;
    color: var(--cc-text-main);
    text-align: right;
    white-space: nowrap;
    padding-left: 15px;
    flex-shrink: 0;
}

/* Ensures the text container grows to full width so the flex row spreads out */
.church-campus-detail-services {
    align-items: flex-start;
}
.church-campus-detail-services .church-campus-detail-text {
    width: calc(100% - 35px); /* Subtract icon width + gap */
}

/* Social Links */
.church-campus-detail-social {
    padding: 15px 20px;
    display: flex;
    gap: 15px;
    border-bottom: 1px solid var(--cc-border-light);
}
.church-campus-social-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--cc-text-main);
    text-decoration: none;
    font-size: 13px;
    background: var(--cc-card-bg);
    padding: 8px 15px;
    border-radius: 20px;
    transition: background 0.2s;
}
.church-campus-social-link:hover {
    background: var(--cc-card-hover);
}
.icon-facebook, .icon-youtube {
    width: 16px;
    height: 16px;
    opacity: 1;
}
/* We will use CSS masking for dynamic themed colors instead of hardcoded SVGs later, but for now we leave as is */
.theme-dark .icon-facebook { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="%23fff"><path d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"></path></svg>'); }
.theme-dark .icon-youtube { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="%23fff"><path d="M22.54 6.42a2.78 2.78 0 0 0-1.94-2C18.88 4 12 4 12 4s-6.88 0-8.6.46a2.78 2.78 0 0 0-1.94 2A29 29 0 0 0 1 11.75a29 29 0 0 0 .46 5.33A2.78 2.78 0 0 0 3.4 19c1.72.46 8.6.46 8.6.46s6.88 0 8.6-.46a2.78 2.78 0 0 0 1.94-2 29 29 0 0 0 .46-5.25 29 29 0 0 0-.46-5.33z"></path><polygon points="9.75 15.02 15.5 11.75 9.75 8.48 9.75 15.02" fill="%23191919"></polygon></svg>'); }
.theme-light .icon-facebook { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="%23222"><path d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"></path></svg>'); }
.theme-light .icon-youtube { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="%23222"><path d="M22.54 6.42a2.78 2.78 0 0 0-1.94-2C18.88 4 12 4 12 4s-6.88 0-8.6.46a2.78 2.78 0 0 0-1.94 2A29 29 0 0 0 1 11.75a29 29 0 0 0 .46 5.33A2.78 2.78 0 0 0 3.4 19c1.72.46 8.6.46 8.6.46s6.88 0 8.6-.46a2.78 2.78 0 0 0 1.94-2 29 29 0 0 0 .46-5.25 29 29 0 0 0-.46-5.33z"></path><polygon points="9.75 15.02 15.5 11.75 9.75 8.48 9.75 15.02" fill="%23fff"></polygon></svg>'); }

.church-campus-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    background-color: var(--cc-border);
    background-size: cover;
    background-position: center;
}

.church-campus-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    flex-shrink: 0;
    opacity: 0.7;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.icon-map { 
    background-color: var(--cc-text-main);
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path><circle cx="12" cy="10" r="3"></circle></svg>') no-repeat center;
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path><circle cx="12" cy="10" r="3"></circle></svg>') no-repeat center;
}
.icon-clock { 
    background-color: var(--cc-text-main);
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>') no-repeat center;
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>') no-repeat center;
}
.icon-globe { 
    background-color: var(--cc-text-main);
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"></circle><line x1="2" y1="12" x2="22" y2="12"></line><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path></svg>') no-repeat center;
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"></circle><line x1="2" y1="12" x2="22" y2="12"></line><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path></svg>') no-repeat center;
}
.icon-mail { 
    width: 32px; 
    height: 32px; 
    border-radius: 50%; 
    background-color: var(--cc-border); 
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23888" stroke-width="2"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path><polyline points="22,6 12,13 2,6"></polyline></svg>'); 
    background-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}
.icon-mail:hover { background-color: var(--cc-hover); }

.church-campus-detail-good-to-know {
    margin-top: 30px;
}
.church-campus-detail-good-to-know h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--cc-text-main);
    margin: 0 0 15px 0;
}
.church-campus-events-content {
    background: var(--cc-bg-sidebar);
    border-radius: 8px;
    padding: 20px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--cc-text-muted);
}
.church-campus-events-content p {
    margin-top: 0;
}
.church-campus-events-content p:last-child {
    margin-bottom: 0;
}
