/**
 * Frontend Styles for Contractor Finder
 */

.brixzly-cf-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.brixzly-cf-search-form {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.brixzly-cf-search-form h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.brixzly-cf-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.brixzly-cf-form-field {
    flex: 1;
}

.brixzly-cf-form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.brixzly-cf-form-field input,
.brixzly-cf-form-field select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.brixzly-cf-form-field .description {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.brixzly-cf-form-actions {
    margin-top: 20px;
}

.brixzly-cf-search-btn {
    background: #0073aa;
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

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

.brixzly-cf-results {
    margin-top: 30px;
}

.brixzly-cf-loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #666;
}

.brixzly-cf-results-header {
    margin-bottom: 20px;
}

.brixzly-cf-results-header h3 {
    margin: 0;
    color: #333;
}

.brixzly-cf-contractors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.brixzly-cf-contractor-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s;
    position: relative;
}

.brixzly-cf-contractor-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.brixzly-cf-favorite-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.brixzly-cf-favorite-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

.brixzly-cf-favorite-btn:active {
    transform: scale(0.95);
}

.brixzly-cf-heart-icon {
    font-size: 24px;
    color: #ccc;
    transition: all 0.3s ease;
    line-height: 1;
    display: inline-block;
}

.brixzly-cf-favorite-btn.is-favorite .brixzly-cf-heart-icon {
    color: #e74c3c;
    transform: scale(1.2);
    animation: heartBeat 0.5s ease;
}

@keyframes heartBeat {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(1.1);
    }
    75% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1.2);
    }
}

.brixzly-cf-contractor-header {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.brixzly-cf-contractor-header h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 20px;
}

.brixzly-cf-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.brixzly-cf-rating-value {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.brixzly-cf-stars {
    color: #ffa500;
    font-size: 16px;
}

.brixzly-cf-review-count {
    color: #666;
    font-size: 14px;
}

.brixzly-cf-contractor-details {
    margin-bottom: 20px;
}

.brixzly-cf-contractor-details p {
    margin: 8px 0;
    color: #555;
    font-size: 14px;
}

.brixzly-cf-contractor-details a {
    color: #0073aa;
    text-decoration: none;
}

.brixzly-cf-contractor-details a:hover {
    text-decoration: underline;
}

.brixzly-cf-reviews {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.brixzly-cf-reviews h5 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.brixzly-cf-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.brixzly-cf-review-item {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
}

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

.brixzly-cf-review-header strong {
    color: #333;
    font-size: 14px;
}

.brixzly-cf-review-rating {
    color: #ffa500;
    font-size: 14px;
}

.brixzly-cf-review-text {
    margin: 0 0 5px 0;
    color: #666;
    font-size: 13px;
    line-height: 1.5;
}

.brixzly-cf-review-time {
    display: block;
    color: #999;
    font-size: 12px;
    margin-top: 5px;
}

.brixzly-cf-reviews-more {
    display: none;
}

.brixzly-cf-show-more-reviews,
.brixzly-cf-show-less-reviews {
    background: transparent;
    border: 1px solid #0073aa;
    color: #0073aa;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    transition: all 0.3s;
}

.brixzly-cf-show-more-reviews:hover,
.brixzly-cf-show-less-reviews:hover {
    background: #0073aa;
    color: #fff;
}

.brixzly-cf-contractor-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.brixzly-cf-view-details-btn {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
    width: 100%;
}

.brixzly-cf-view-details-btn:hover {
    background: #005a87;
}

/* Modal Styles */
.brixzly-cf-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.brixzly-cf-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.brixzly-cf-modal-content {
    background-color: #fff;
    margin: auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    height: 90vh;
    max-height: 90vh;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}


@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.brixzly-cf-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #fff;
    border: 2px solid #e0e0e0;
    font-size: 24px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
    z-index: 100;
    line-height: 1;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.brixzly-cf-modal-close:hover {
    background: #f0f0f0;
    border-color: #ccc;
    color: #333;
}

.brixzly-cf-detail-modal-content {
    padding: 30px;
    padding-top: 60px;
    box-sizing: border-box;
}

/* Override any GreenShift or other plugin styles that might interfere */
.brixzly-cf-modal .brixzly-cf-modal-content .brixzly-cf-detail-modal-content {
    position: static !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.brixzly-cf-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 20px;
    padding-right: 60px;
    border-bottom: 2px solid #e0e0e0;
    position: relative;
}

.brixzly-cf-detail-header h2 {
    margin: 0;
    flex: 1;
    padding-right: 50px;
}

.brixzly-cf-favorite-btn-modal {
    position: absolute;
    top: 0;
    right: 50px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 50;
}

.brixzly-cf-favorite-btn-modal:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

.brixzly-cf-favorite-btn-modal .brixzly-cf-heart-icon {
    font-size: 24px;
    color: #ccc;
    transition: all 0.3s ease;
    line-height: 1;
    display: inline-block;
}

.brixzly-cf-favorite-btn-modal.is-favorite .brixzly-cf-heart-icon {
    color: #e74c3c;
    transform: scale(1.2);
}

.brixzly-cf-detail-header h2 {
    margin: 0;
    flex: 1;
    color: #333;
}

.brixzly-cf-detail-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.brixzly-cf-detail-info {
    margin-bottom: 30px;
}

.brixzly-cf-detail-item {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.brixzly-cf-detail-item strong {
    display: block;
    color: #333;
    font-size: 14px;
    margin-bottom: 5px;
}

.brixzly-cf-detail-item p {
    margin: 0;
    color: #555;
    font-size: 15px;
}

.brixzly-cf-detail-item a {
    color: #0073aa;
    text-decoration: none;
}

.brixzly-cf-detail-item a:hover {
    text-decoration: underline;
}

.brixzly-cf-detail-reviews {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.brixzly-cf-detail-reviews h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
}

.brixzly-cf-load-more-reviews {
    margin-top: 20px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.brixzly-cf-load-more-reviews-btn {
    background-color: #007cba;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.brixzly-cf-load-more-reviews-btn:hover:not(:disabled) {
    background-color: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.3);
}

.brixzly-cf-load-more-reviews-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.brixzly-cf-reviews-limit-note {
    margin-top: 15px;
    padding: 12px;
    background: #f0f0f0;
    border-left: 3px solid #0073aa;
    border-radius: 4px;
    color: #666;
    font-size: 13px;
    line-height: 1.5;
}

.brixzly-cf-reviews-limit-note small {
    display: block;
}

.brixzly-cf-view-all-reviews {
    margin-top: 15px;
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.brixzly-cf-google-reviews-link {
    display: inline-block;
    color: #1a73e8;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 16px;
    border: 1px solid #1a73e8;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.brixzly-cf-google-reviews-link:hover {
    background-color: #1a73e8;
    color: #fff;
    text-decoration: none;
}

.brixzly-cf-google-reviews-link-large {
    font-size: 16px;
    padding: 12px 24px;
    margin-bottom: 15px;
}

.brixzly-cf-star {
    display: inline-block;
}

.brixzly-cf-star-full {
    color: #ffa500;
}

.brixzly-cf-star-half {
    color: #ffa500;
    opacity: 0.7;
}

.brixzly-cf-star-empty {
    color: #ddd;
}

.brixzly-cf-no-results {
    text-align: center;
    padding: 40px;
    background: #f9f9f9;
    border-radius: 8px;
    color: #666;
}

.brixzly-cf-results-info {
    margin: 10px 0 0 0;
    color: #666;
    font-size: 14px;
}

.brixzly-cf-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
}

.brixzly-cf-pagination-btn {
    background: #0073aa;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.brixzly-cf-pagination-btn:hover {
    background: #005a87;
}

.brixzly-cf-pagination-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.brixzly-cf-pagination-info {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* AI Recommendations */
.brixzly-cf-ai-recommendations-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.brixzly-cf-ai-recommendations-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.brixzly-cf-ai-recommendations-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.brixzly-cf-recommendations-container {
    background: #f8f9fa;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 25px;
    margin-top: 20px;
}

.brixzly-cf-recommendations-container h4 {
    margin-top: 0;
    color: #667eea;
    font-size: 20px;
}

.brixzly-cf-recommendations-summary {
    font-size: 15px;
    color: #555;
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border-left: 4px solid #667eea;
    border-radius: 4px;
}

.brixzly-cf-recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.brixzly-cf-recommendation-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    gap: 20px;
    transition: all 0.3s ease;
}

.brixzly-cf-recommendation-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.brixzly-cf-recommendation-rank {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
}

.brixzly-cf-recommendation-content {
    flex: 1;
}

.brixzly-cf-recommendation-content h5 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    font-size: 18px;
}

.brixzly-cf-recommendation-reasoning {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.brixzly-cf-recommendation-strengths,
.brixzly-cf-recommendation-considerations {
    margin-bottom: 10px;
}

.brixzly-cf-recommendation-strengths strong {
    color: #28a745;
}

.brixzly-cf-recommendation-considerations strong {
    color: #ffc107;
}

.brixzly-cf-recommendation-strengths ul,
.brixzly-cf-recommendation-considerations ul {
    margin: 5px 0;
    padding-left: 20px;
}

.brixzly-cf-recommendation-strengths li,
.brixzly-cf-recommendation-considerations li {
    margin-bottom: 5px;
}

.brixzly-cf-view-recommended-btn {
    background: #667eea;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.3s ease;
}

.brixzly-cf-view-recommended-btn:hover {
    background: #5568d3;
}

/* Search History Styles */
.brixzly-cf-search-history-container {
    margin: 30px 0;
}

.brixzly-cf-search-history-title {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.brixzly-cf-search-history-empty {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
    background: #f9f9f9;
    border-radius: 4px;
}

.brixzly-cf-search-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.brixzly-cf-search-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.brixzly-cf-search-history-item:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 6px rgba(0, 115, 170, 0.1);
    transform: translateY(-1px);
}

.brixzly-cf-search-history-item.deleting {
    opacity: 0.5;
    pointer-events: none;
}

.brixzly-cf-search-history-content {
    flex: 1;
    min-width: 0;
}

.brixzly-cf-search-history-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 15px;
    word-wrap: break-word;
}

.brixzly-cf-search-history-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.brixzly-cf-search-history-time {
    font-size: 12px;
    color: #888;
}

.brixzly-cf-search-history-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 15px;
    flex-shrink: 0;
}

.brixzly-cf-search-history-rerun {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
}

.brixzly-cf-search-history-rerun:hover {
    background: #005a87;
}

.brixzly-cf-search-history-delete {
    background: transparent;
    color: #999;
    border: none;
    padding: 5px 10px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brixzly-cf-search-history-delete:hover {
    background: #f0f0f0;
    color: #d63638;
}

/* Responsive */
@media (max-width: 768px) {
    .brixzly-cf-form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .brixzly-cf-contractors-grid {
        grid-template-columns: 1fr;
    }
    
    .brixzly-cf-container {
        padding: 15px;
    }
    
    .brixzly-cf-search-history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .brixzly-cf-search-history-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }
    
    .brixzly-cf-search-history-rerun {
        flex: 1;
    }
}

