/**
 * Frontend Styles for Business Directory Plugin
 */

/* Container and Layout */
.bdr-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.bdr-container * {
    box-sizing: border-box;
}

/* Search Section */
.bdr-search-container {
    margin-bottom: 30px;
}

.bdr-search-form {
    display: flex;
    justify-content: center;
}

.bdr-search-input-group {
    display: flex;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.bdr-search-input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    font-size: 16px;
    outline: none;
}

.bdr-search-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 15px 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.bdr-search-btn:hover {
    background: #005a87;
}

/* Filters */
.bdr-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
    align-items: end;
}

.bdr-filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.bdr-filter-group label {
    font-weight: 500;
    margin-bottom: 5px;
    color: #333;
    font-size: 14px;
}

.bdr-filter-group input,
.bdr-filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
}

.bdr-filter-group input:focus,
.bdr-filter-group select:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0,124,186,0.1);
}

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

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

.bdr-btn-primary:hover {
    background: #005a87;
}

.bdr-btn-secondary {
    background: #6c757d;
    color: white;
}

.bdr-btn-secondary:hover {
    background: #545b62;
}

.bdr-btn-link {
    background: none;
    color: #007cba;
    text-decoration: underline;
}

.bdr-btn-link:hover {
    color: #005a87;
}

.bdr-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Actions Section */
.bdr-actions {
    margin-bottom: 25px;
    text-align: center;
}

.bdr-login-prompt {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.bdr-login-prompt p {
    margin-bottom: 15px;
    color: #666;
}

/* Social Login */
.bdr-social-login {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.bdr-social-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.bdr-google-btn {
    background: #db4437;
    color: white;
}

.bdr-google-btn:hover {
    background: #c23321;
}

.bdr-facebook-btn {
    background: #3b5998;
    color: white;
}

.bdr-facebook-btn:hover {
    background: #2d4373;
}

/* Business Grid */
.bdr-business-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.bdr-business-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
    cursor: pointer;
}

.bdr-business-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.bdr-business-header {
    margin-bottom: 15px;
}

.bdr-business-name {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
}

.bdr-business-name a {
    color: #333;
    text-decoration: none;
}

.bdr-business-name a:hover {
    color: #007cba;
}

.bdr-claimed-badge {
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
}

.bdr-business-rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bdr-rating-count {
    color: #666;
    font-size: 14px;
}

.bdr-business-info {
    margin-bottom: 15px;
}

.bdr-business-description {
    color: #666;
    line-height: 1.5;
    margin-bottom: 10px;
}

.bdr-business-location {
    display: flex;
    align-items: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.bdr-business-category {
    margin-top: 8px;
}

.bdr-category-tag {
    background: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.bdr-business-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Star Rating */
.bdr-star-rating {
    display: flex;
    gap: 2px;
}

.bdr-star {
    color: #ffc107;
    font-size: 16px;
}

.bdr-star-empty {
    color: #ddd;
}

.bdr-star-half {
    color: #ffc107;
}

/* Rating Input */
.bdr-rating-input {
    display: flex;
    gap: 5px;
}

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

.bdr-star-label {
    font-size: 24px;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
}

.bdr-star-label:hover,
.bdr-star-label.active {
    color: #ffc107;
}

.bdr-rating-input input[type="radio"]:checked ~ .bdr-star-label,
.bdr-rating-input .bdr-star-label:hover ~ .bdr-star-label {
    color: #ddd;
}

.bdr-rating-input input[type="radio"]:checked + .bdr-star-label,
.bdr-rating-input .bdr-star-label:hover {
    color: #ffc107;
}

/* Business Details */
.bdr-business-details {
    max-width: 600px;
}

.bdr-business-details .bdr-business-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.bdr-business-details h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
}

.bdr-section {
    margin-bottom: 25px;
}

.bdr-section h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.bdr-contact-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bdr-contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

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

/* Reviews Section */
.bdr-reviews-section {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.bdr-reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.bdr-reviews-header h4 {
    margin: 0;
}

.bdr-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bdr-review-item {
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
}

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

.bdr-reviewer-name {
    font-weight: 600;
    color: #333;
}

.bdr-review-date {
    color: #666;
    font-size: 14px;
    margin-left: 10px;
}

.bdr-review-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 500;
}

.bdr-review-content p {
    margin: 0;
    line-height: 1.5;
    color: #555;
}

.bdr-no-reviews {
    text-align: center;
    color: #666;
    font-style: italic;
}

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

/* Modals */
.bdr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.bdr-modal-content {
    background: white;
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.bdr-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.bdr-modal-close:hover {
    color: #333;
}

.bdr-modal h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
}

/* Forms */
.bdr-form-group {
    margin-bottom: 20px;
}

.bdr-form-row {
    display: flex;
    gap: 15px;
}

.bdr-form-row .bdr-form-group {
    flex: 1;
}

.bdr-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.bdr-form-group input,
.bdr-form-group select,
.bdr-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
}

.bdr-form-group input:focus,
.bdr-form-group select:focus,
.bdr-form-group textarea:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0,124,186,0.1);
}

.bdr-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.bdr-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

/* Loading */
.bdr-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

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

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

/* Notifications */
.bdr-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    z-index: 10001;
    transform: translateX(100%);
    transition: transform 0.3s;
    max-width: 400px;
}

.bdr-notification.show {
    transform: translateX(0);
}

.bdr-notification-success {
    background: #28a745;
}

.bdr-notification-error {
    background: #dc3545;
}

/* Pagination */
.bdr-pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 30px;
}

.bdr-pagination a,
.bdr-pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #007cba;
    border-radius: 4px;
}

.bdr-pagination a:hover {
    background: #007cba;
    color: white;
}

.bdr-pagination .current {
    background: #007cba;
    color: white;
}

/* Icons */
.bdr-icon-search:before { content: "🔍"; }
.bdr-icon-location:before { content: "📍"; }
.bdr-icon-phone:before { content: "📞"; }
.bdr-icon-email:before { content: "✉️"; }
.bdr-icon-website:before { content: "🌐"; }

/* Social Icons */
.bdr-social-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
}

.bdr-google-icon:before { content: "G"; }
.bdr-facebook-icon:before { content: "f"; }

/* Responsive Design */
@media (max-width: 768px) {
    .bdr-container {
        padding: 15px;
    }
    
    .bdr-search-input-group {
        flex-direction: column;
    }
    
    .bdr-search-btn {
        border-radius: 0 0 8px 8px;
    }
    
    .bdr-filters {
        flex-direction: column;
        gap: 10px;
    }
    
    .bdr-filter-group {
        min-width: auto;
    }
    
    .bdr-business-grid {
        grid-template-columns: 1fr;
    }
    
    .bdr-business-actions {
        flex-direction: column;
    }
    
    .bdr-reviews-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .bdr-form-row {
        flex-direction: column;
    }
    
    .bdr-form-actions {
        flex-direction: column;
    }
    
    .bdr-modal-content {
        padding: 20px;
        margin: 10px;
    }
    
    .bdr-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Prevent body scroll when modal is open */
body.bdr-modal-open {
    overflow: hidden;
}
