/**
 * Church Finder Frontend Styles
 * 
 * Responsive and modern styling for the church finder interface
 */

/* Main Container */
.church-finder-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

/* Controls Section */
.church-finder-controls {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.church-search-box {
    display: flex;
    gap: 10px;
    flex: 1;
    min-width: 250px;
}

.church-search-box input[type="text"] {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.church-search-box input[type="text"]:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.church-filters select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background: white;
    min-width: 150px;
}

.church-view-toggle {
    display: flex;
    gap: 5px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.view-toggle {
    padding: 10px 15px;
    border: none;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.view-toggle:hover {
    background: #f0f0f0;
}

.view-toggle.active {
    background: #007cba;
    color: white;
}

.church-results-info {
    font-size: 14px;
    color: #666;
    margin-left: auto;
}

/* Buttons */
.church-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    text-align: center;
}

.church-btn-primary {
    background: #007cba;
    color: white;
}

.church-btn-primary:hover {
    background: #005a87;
    color: white;
}

/* Loading */
.church-finder-loading {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* List View */
.church-list-view {
    margin-bottom: 30px;
}

.church-district-group {
    margin-bottom: 40px;
}

.district-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007cba;
    display: flex;
    align-items: center;
    gap: 10px;
}

.district-count {
    font-size: 16px;
    font-weight: 400;
    color: #666;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 12px;
}

.district-churches {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Grid View */
.church-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

/* Church Cards */
.church-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.church-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.church-card-list {
    display: flex;
    gap: 20px;
}

.church-card-grid {
    display: flex;
    flex-direction: column;
}

.church-image {
    flex-shrink: 0;
}

.church-card-list .church-image {
    width: 200px;
    height: 150px;
}

.church-card-grid .church-image {
    width: 100%;
    height: 200px;
}

.church-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.church-content {
    padding: 20px;
    flex: 1;
}

.church-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #333;
}

.church-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.church-title a:hover {
    color: #007cba;
}

.church-districts {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.district-tag {
    background: #007cba;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.church-address,
.church-pastor {
    margin-bottom: 10px;
    color: #666;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.church-address .dashicons,
.church-pastor .dashicons {
    color: #007cba;
    font-size: 16px;
}

.church-contact {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.contact-item .dashicons {
    color: #007cba;
    font-size: 16px;
}

.contact-item a {
    color: #007cba;
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

.church-services {
    margin-bottom: 15px;
}

.church-services h5 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #333;
}

.service-times-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.service-times-list li {
    padding: 5px 0;
    font-size: 14px;
    color: #666;
    border-bottom: 1px solid #f0f0f0;
}

.service-times-list li:last-child {
    border-bottom: none;
}

.church-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* Map */
.church-map-container {
    margin-top: 30px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.church-map-container.hidden {
    display: none;
}

#church-map {
    width: 100%;
    min-height: 500px;
    padding: 20px;
}

.church-map-links h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 24px;
    text-align: center;
}

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

.map-link-item {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.3s ease;
}

.map-link-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.map-link-item h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

.map-link-item .address {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
}

.map-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #007cba;
    color: white;
    padding: 10px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.map-link-btn:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

.map-link-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.no-map-link {
    color: #999;
    font-style: italic;
}

.church-map-info {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* No Results */
.church-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.church-no-results p {
    font-size: 18px;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .church-finder-wrapper {
        padding: 15px;
    }
    
    .church-finder-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .church-search-box {
        min-width: auto;
    }
    
    .church-view-toggle {
        justify-content: center;
    }
    
    .church-results-info {
        margin-left: 0;
        text-align: center;
    }
    
    .church-card-list {
        flex-direction: column;
    }
    
    .church-card-list .church-image {
        width: 100%;
        height: 200px;
    }
    
    .church-grid-view {
        grid-template-columns: 1fr;
    }
    
    .district-title {
        font-size: 20px;
    }
    
    .church-contact {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .church-finder-wrapper {
        padding: 10px;
    }
    
    .church-finder-controls {
        padding: 15px;
    }
    
    .church-content {
        padding: 15px;
    }
    
    .view-toggle {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .view-toggle .dashicons {
        display: none;
    }
}

/* Accessibility */
.church-finder-wrapper *:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.church-finder-wrapper button:focus,
.church-finder-wrapper input:focus,
.church-finder-wrapper select:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .church-finder-controls,
    .church-map-container {
        display: none;
    }
    
    .church-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .church-grid-view {
        grid-template-columns: 1fr;
    }
}