/* WP Business Directory - Frontend Styles */

/* General */
.wpbd-notice {
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    border: 1px solid;
}

.wpbd-notice.wpbd-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.wpbd-notice.wpbd-error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.wpbd-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.wpbd-button:hover {
    background-color: #005a87;
    color: #fff;
    text-decoration: none;
}

.wpbd-button.wpbd-button-small {
    padding: 5px 15px;
    font-size: 13px;
}

/* Directory Listing */
.wpbd-directory-wrapper {
    margin: 20px 0;
}

.wpbd-directory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.wpbd-results-count {
    font-size: 16px;
    color: #666;
}

.wpbd-view-options a {
    display: inline-block;
    padding: 5px;
    margin-left: 5px;
    color: #666;
    text-decoration: none;
}

.wpbd-view-options a.active {
    color: #0073aa;
}

/* Listings Container */
.wpbd-listings-container {
    margin: 20px 0;
}

.wpbd-listings-container.wpbd-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Grid Layout */
.wpbd-layout-grid {
    display: grid;
    gap: 20px;
}

.wpbd-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.wpbd-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.wpbd-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Responsive Grid */
@media (max-width: 1024px) {
    .wpbd-columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .wpbd-columns-3,
    .wpbd-columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .wpbd-columns-2,
    .wpbd-columns-3,
    .wpbd-columns-4 {
        grid-template-columns: 1fr;
    }
}

/* Listing Card */
.wpbd-listing-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

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

.wpbd-listing-card.wpbd-featured {
    border-color: #f1c40f;
}

.wpbd-featured-ribbon {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #f1c40f;
    color: #333;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 20px;
    z-index: 1;
}

.wpbd-listing-image {
    position: relative;
    padding-bottom: 60%;
    overflow: hidden;
    background-color: #f8f9fa;
}

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

.wpbd-no-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
}

.wpbd-no-image .dashicons {
    font-size: 48px;
    color: #ccc;
}

.wpbd-listing-content {
    padding: 20px;
}

.wpbd-listing-title {
    margin: 0 0 10px;
    font-size: 20px;
    line-height: 1.3;
}

.wpbd-listing-title a {
    color: #333;
    text-decoration: none;
}

.wpbd-listing-title a:hover {
    color: #0073aa;
}

.wpbd-listing-categories {
    margin-bottom: 10px;
}

.wpbd-category-badge {
    display: inline-block;
    padding: 3px 8px;
    background-color: #e9ecef;
    color: #495057;
    font-size: 12px;
    border-radius: 4px;
    text-decoration: none;
    margin-right: 5px;
    margin-bottom: 5px;
}

.wpbd-category-badge:hover {
    background-color: #dee2e6;
    color: #495057;
}

.wpbd-listing-meta {
    margin: 15px 0;
}

.wpbd-meta-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.wpbd-meta-item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    color: #999;
}

.wpbd-rating-stars {
    color: #f1c40f;
    font-size: 16px;
}

.wpbd-rating-count {
    margin-left: 5px;
    color: #999;
    font-size: 14px;
}

/* List Layout */
.wpbd-layout-list .wpbd-listing-card {
    display: flex;
    margin-bottom: 20px;
}

.wpbd-layout-list .wpbd-listing-image {
    flex: 0 0 200px;
    padding-bottom: 0;
    height: 150px;
}

.wpbd-layout-list .wpbd-listing-content {
    flex: 1;
    padding: 20px;
}

.wpbd-layout-list .wpbd-listing-excerpt {
    margin: 10px 0;
    color: #666;
    line-height: 1.6;
}

/* Search Form */
.wpbd-search-form {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.wpbd-search-main {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.wpbd-search-field {
    flex: 1;
    min-width: 200px;
}

.wpbd-search-field input[type="text"],
.wpbd-search-field select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.wpbd-search-submit {
    flex: 0 0 auto;
}

.wpbd-search-button {
    display: flex;
    align-items: center;
    gap: 5px;
}

.wpbd-advanced-toggle {
    display: inline-block;
    margin-top: 15px;
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
}

.wpbd-advanced-toggle:hover {
    text-decoration: underline;
}

.wpbd-advanced-fields {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* Submission Form */
.wpbd-submission-form {
    max-width: 800px;
    margin: 0 auto;
}

.wpbd-fieldset {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.wpbd-fieldset legend {
    font-size: 18px;
    font-weight: bold;
    padding: 0 10px;
}

.wpbd-form-group {
    margin-bottom: 20px;
}

.wpbd-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.wpbd-form-group input[type="text"],
.wpbd-form-group input[type="email"],
.wpbd-form-group input[type="tel"],
.wpbd-form-group input[type="url"],
.wpbd-form-group textarea,
.wpbd-form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.wpbd-form-group textarea {
    resize: vertical;
}

.wpbd-form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 13px;
}

.required {
    color: #dc3545;
}

.wpbd-form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.wpbd-form-row .wpbd-form-group {
    flex: 1;
    min-width: 200px;
}

.wpbd-hours-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.wpbd-day-label {
    flex: 0 0 100px;
    font-weight: bold;
}

.wpbd-hours-inputs {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wpbd-hours-inputs input[type="time"] {
    width: 120px;
    padding: 5px;
}

/* Single Listing */
.wpbd-single-listing {
    margin: 20px 0;
}

.wpbd-listing-header {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.wpbd-listing-logo {
    flex: 0 0 200px;
}

.wpbd-listing-logo img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.wpbd-listing-info {
    flex: 1;
}

.wpbd-listing-content {
    display: flex;
    gap: 30px;
}

.wpbd-main-content {
    flex: 1;
}

.wpbd-sidebar {
    flex: 0 0 300px;
}

.wpbd-contact-details {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.wpbd-contact-details h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

.wpbd-contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.wpbd-contact-item .dashicons {
    margin-right: 10px;
    color: #0073aa;
}

.wpbd-contact-item a {
    color: #333;
    text-decoration: none;
}

.wpbd-contact-item a:hover {
    color: #0073aa;
}

.wpbd-contact-item address {
    font-style: normal;
}

.wpbd-business-hours {
    margin: 30px 0;
}

.wpbd-business-hours h3 {
    margin-bottom: 15px;
    font-size: 18px;
}

.wpbd-hours-table {
    width: 100%;
    border-collapse: collapse;
}

.wpbd-hours-table td {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.wpbd-hours-table .wpbd-day {
    font-weight: bold;
    width: 40%;
}

.wpbd-listing-map {
    margin: 30px 0;
}

.wpbd-listing-map h3 {
    margin-bottom: 15px;
    font-size: 18px;
}

/* Reviews */
.wpbd-reviews-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #e0e0e0;
}

.wpbd-review-form {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.wpbd-rating-stars {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    margin-bottom: 15px;
}

.wpbd-rating-stars input[type="radio"] {
    display: none;
}

.wpbd-rating-stars label {
    font-size: 30px;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
}

.wpbd-rating-stars input:checked ~ label,
.wpbd-rating-stars label:hover,
.wpbd-rating-stars label:hover ~ label {
    color: #f1c40f;
}

.wpbd-review-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
}

.wpbd-reviews-list {
    margin-top: 20px;
}

.wpbd-review {
    padding: 20px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 20px;
}

.wpbd-review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.wpbd-review-rating {
    color: #f1c40f;
    margin: 0 15px;
}

.wpbd-review-date {
    color: #666;
    font-size: 14px;
}

.wpbd-review-content {
    line-height: 1.6;
    color: #333;
}

/* Pagination */
.wpbd-pagination {
    text-align: center;
    margin: 40px 0;
}

.wpbd-pagination a,
.wpbd-pagination span {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    background-color: #fff;
    border-radius: 4px;
}

.wpbd-pagination a:hover {
    background-color: #f8f9fa;
}

.wpbd-pagination .current {
    background-color: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* Categories Widget */
.wpbd-categories-grid {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.wpbd-category-item {
    text-align: center;
}

.wpbd-category-link {
    display: block;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.wpbd-category-link:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.wpbd-category-icon {
    font-size: 48px;
    color: #0073aa;
    margin-bottom: 10px;
}

.wpbd-category-name {
    margin: 10px 0;
    font-size: 18px;
    color: #333;
}

.wpbd-category-count {
    color: #666;
    font-size: 14px;
}

/* Map Container */
.wpbd-map-container {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.wpbd-map-info {
    padding: 10px;
}

.wpbd-map-info h4 {
    margin: 0 0 5px;
    font-size: 16px;
}

.wpbd-map-info h4 a {
    color: #0073aa;
    text-decoration: none;
}

.wpbd-map-info h4 a:hover {
    text-decoration: underline;
}

.wpbd-map-info p {
    margin: 5px 0;
    font-size: 14px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .wpbd-search-main {
        flex-direction: column;
    }
    
    .wpbd-search-field {
        width: 100%;
    }
    
    .wpbd-listing-header {
        flex-direction: column;
    }
    
    .wpbd-listing-logo {
        flex: 0 0 auto;
        max-width: 200px;
        margin: 0 auto;
    }
    
    .wpbd-listing-content {
        flex-direction: column;
    }
    
    .wpbd-sidebar {
        flex: 0 0 auto;
        width: 100%;
    }
    
    .wpbd-layout-list .wpbd-listing-card {
        flex-direction: column;
    }
    
    .wpbd-layout-list .wpbd-listing-image {
        flex: 0 0 auto;
        width: 100%;
        height: 200px;
    }
}

/* Print Styles */
@media print {
    .wpbd-search-form,
    .wpbd-filters,
    .wpbd-view-options,
    .wpbd-pagination,
    .wpbd-listing-actions,
    .wpbd-review-form {
        display: none;
    }
    
    .wpbd-listing-card {
        page-break-inside: avoid;
    }
}
