/* RankRight Front-End Styles */

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

/* Header */
.listing-header {
    margin-bottom: 30px;
}

.listing-title {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.listing-rating-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2em;
    flex-wrap: wrap;
}

.rating-score {
    font-size: 2em;
    font-weight: bold;
    color: #f39c12;
}

.rating-stars {
    color: #f39c12;
    font-size: 1.5em;
    white-space: nowrap;
    overflow: hidden;
}

/* Mobile responsive rating */
@media (max-width: 768px) {
    .listing-rating-badge {
        font-size: 1em;
        gap: 8px;
    }
    
    .rating-score {
        font-size: 1.5em;
    }
    
    .rating-stars {
        font-size: 1.2em;
    }
}

@media (max-width: 480px) {
    .listing-rating-badge {
        font-size: 0.9em;
        gap: 6px;
    }
    
    .rating-score {
        font-size: 1.3em;
    }
    
    .rating-stars {
        font-size: 1em;
    }
}

/* Gallery */
.listing-gallery {
    margin: 30px 0;
}

.gallery-main img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.gallery-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.gallery-thumb {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-thumb:hover {
    transform: scale(1.05);
}

/* Contact Buttons */
.listing-contact-buttons {
    display: flex;
    gap: 15px;
    margin: 30px 0;
}

.btn-contact {
    flex: 1;
    padding: 15px 30px;
    text-align: center;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-call {
    background: #27ae60;
    color: white;
}

.btn-call:hover {
    background: #229954;
}

.btn-website {
    background: #3498db;
    color: white;
}

.btn-website:hover {
    background: #2980b9;
}

.btn-email {
    background: #e67e22;
    color: white;
}

.btn-email:hover {
    background: #d35400;
}

.btn-map {
    background: #1a73e8;
    color: white;
}

.btn-map:hover {
    background: #1557b0;
    color: white;
}

.listing-address {
    background: #f8f9fa;
    padding: 15px 20px;
    border-left: 4px solid #667eea;
    margin: 20px 0;
    border-radius: 4px;
}

.listing-address strong {
    color: #333;
}

/* Rating Summary Box */
.rating-summary-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin: 40px 0;
}

.overall-rating {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
}

.overall-score-circle {
    text-align: center;
}

.score-percentage {
    display: block;
    font-size: 3em;
    font-weight: bold;
}

.score-label {
    display: block;
    font-size: 0.9em;
    opacity: 0.9;
}

.star-rating-large {
    font-size: 2em;
    font-weight: bold;
}

.criteria-breakdown {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 8px;
}

.criteria-breakdown h3 {
    margin-top: 0;
}

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

.criterion-name {
    min-width: 150px;
}

.criterion-bar {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    overflow: hidden;
}

.criterion-fill {
    height: 100%;
    background: #f39c12;
    border-radius: 5px;
    transition: width 0.3s;
}

.criterion-score {
    min-width: 40px;
    text-align: right;
    font-weight: bold;
}

/* Branch Relationships */
.listing-branches,
.listing-parent-branch {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
}

.branch-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.branch-list li {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

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

.branch-list a {
    color: #667eea;
    text-decoration: none;
}

.branch-list a:hover {
    text-decoration: underline;
}

/* Review Form */
.review-form-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin: 40px 0;
}

.review-form-section h2 {
    margin-top: 0;
}

.login-required {
    text-align: center;
    padding: 40px;
}

.login-required a {
    color: #667eea;
    font-weight: bold;
}

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

.review-form label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
}

.review-form .form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.criteria-ratings {
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.criterion-rating-input {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.criterion-rating-input:last-child {
    border-bottom: none;
}

.criterion-label {
    font-weight: 500;
}

.star-rating-input {
    display: flex;
    flex-direction: row-reverse;
    gap: 5px;
}

.star-rating-input input {
    display: none;
}

.star-rating-input label {
    font-size: 30px;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
    margin: 0;
}

.star-rating-input input:checked ~ label,
.star-rating-input label:hover,
.star-rating-input label:hover ~ label {
    color: #f39c12;
}

.btn-submit-review {
    background: #667eea;
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-submit-review:hover {
    background: #5568d3;
}

.btn-submit-review:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.form-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
}

/* Reviews List */
.reviews-section {
    margin: 40px 0;
}

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

.reviews-header h2 {
    margin: 0;
}

.review-sort {
    display: flex;
    align-items: center;
    gap: 10px;
}

.review-sort select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

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

.review-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
}

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

.review-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.review-author img {
    border-radius: 50%;
}

.author-info strong {
    display: block;
    font-size: 1.1em;
}

.review-date {
    font-size: 0.9em;
    color: #666;
}

.review-rating .stars {
    color: #f39c12;
    font-size: 1.2em;
}

.review-rating .rating-value {
    margin-left: 8px;
    color: #666;
}

.review-title {
    font-size: 1.2em;
    margin: 10px 0;
}

.review-content {
    line-height: 1.6;
    color: #333;
    margin: 15px 0;
}

.review-criteria-scores {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.criterion-badge {
    background: #f0f0f0;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
}

.admin-reply {
    background: #e8f4f8;
    border-left: 4px solid #3498db;
    padding: 15px;
    margin-top: 15px;
    border-radius: 4px;
}

.admin-reply strong {
    color: #2980b9;
}

.business-owner-reply {
    background: #f0f9ff;
    border-left: 4px solid #667eea;
    padding: 15px;
    margin-top: 15px;
    border-radius: 4px;
}

.business-owner-reply strong {
    color: #667eea;
}

.business-owner-reply .reply-date {
    display: block;
    margin-top: 8px;
    color: #666;
    font-size: 0.9em;
}

.no-reviews {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

/* Leaderboard */
.rankright-leaderboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.leaderboard-header {
    text-align: center;
    margin-bottom: 40px;
}

.leaderboard-title {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.leaderboard-subtitle {
    color: #666;
    font-size: 1.1em;
}

.leaderboard-filters {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: end;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

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

.filter-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.btn-filter {
    padding: 10px 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.btn-filter:hover {
    background: #5568d3;
}

.btn-clear-filters {
    padding: 10px 20px;
    background: #95a5a6;
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.leaderboard-item {
    display: grid;
    grid-template-columns: 80px 200px 1fr 200px;
    gap: 20px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    align-items: center;
    transition: box-shadow 0.3s;
}

.leaderboard-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.rank-badge {
    text-align: center;
}

.rank-number {
    font-size: 2.5em;
    font-weight: bold;
    color: #666;
}

.rank-gold .rank-number { color: #f39c12; }
.rank-silver .rank-number { color: #95a5a6; }
.rank-bronze .rank-number { color: #cd7f32; }

.listing-image img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

.no-image-placeholder {
    width: 100%;
    height: 150px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #999;
}

.listing-info {
    min-width: 0;
}

.listing-name {
    font-size: 1.5em;
    margin: 0 0 10px 0;
}

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

.listing-name a:hover {
    color: #667eea;
}

.listing-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
}

.listing-excerpt {
    color: #666;
    line-height: 1.5;
    margin: 0;
}

.listing-score {
    text-align: center;
}

.score-circle {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 15px;
}

.score-svg {
    transform: rotate(-90deg);
}

.score-bg {
    fill: none;
    stroke: #f0f0f0;
    stroke-width: 8;
}

.score-fill {
    fill: none;
    stroke: #f39c12;
    stroke-width: 8;
    stroke-dasharray: 283;
    stroke-linecap: round;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-percentage {
    font-size: 1.8em;
    font-weight: bold;
    display: block;
}

.rating-details {
    margin-bottom: 15px;
}

.star-rating {
    color: #f39c12;
    margin-bottom: 5px;
}

.review-count {
    font-size: 0.9em;
    color: #666;
}

.btn-view-listing {
    display: inline-block;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
}

.btn-view-listing:hover {
    background: #5568d3;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

/* Responsive */
@media (max-width: 768px) {
    .leaderboard-item {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .listing-contact-buttons {
        flex-direction: column;
    }
    
    .overall-rating {
        flex-direction: column;
    }
    
    .filter-form {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .reviews-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .review-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* Mobile responsive criteria text */
    .criterion-item {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .criterion-name {
        min-width: auto;
        width: 100%;
        margin-bottom: 5px;
        font-size: 0.9em;
    }
    
    .criterion-bar {
        flex: 1;
        min-width: 60%;
    }
    
    .criterion-score {
        min-width: 35px;
        font-size: 0.9em;
    }
}

/* Category Archive Grid Styles */
.rankright-category-archive {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.category-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #eee;
}

.category-title {
    font-size: 2.5em;
    margin-bottom: 15px;
    color: #333;
}

.category-description {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.category-meta {
    color: #999;
    font-size: 0.95em;
}

.search-results-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    margin-bottom: 40px;
}

.search-result-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s;
    display: block !important;
    width: 100% !important;
}

.search-result-card:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    transform: translateY(-4px);
}

.search-result-image {
    position: relative;
    width: 100%;
    height: 140px;
    overflow: hidden;
}

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

.search-result-score {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #f39c12;
    color: white;
    padding: 5px 8px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 12px;
}

.search-result-content {
    padding: 15px;
}

.search-result-title {
    margin: 0 0 8px 0;
    font-size: 1.05em;
    line-height: 1.3;
}

.search-result-title a {
    color: #333;
    text-decoration: none;
}

.search-result-title a:hover {
    color: #667eea;
}

.search-result-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 13px;
}

.search-result-rating .stars {
    color: #f39c12;
    font-size: 14px;
}

.search-result-excerpt {
    color: #666;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.search-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #999;
}

.search-result-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Tablet - 3 columns */
@media (max-width: 1024px) {
    .search-results-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 18px !important;
    }
}

/* Mobile - 1 column */
@media (max-width: 768px) {
    .search-results-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .search-result-image {
        height: 180px;
    }
    
    .search-result-content {
        padding: 18px;
    }
    
    .search-result-title {
        font-size: 1.15em;
    }
    
    .category-title {
        font-size: 2em;
    }
}