/**
 * Agent Profile Public View Styles
 * 
 * Styles for the public-facing agent profile page
 * 
 * @package MalisafiMLS
 */

.agent-profile-public {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Agent Header */
.agent-header {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    gap: 40px;
}

.agent-photo {
    flex-shrink: 0;
}

.agent-photo img {
    width: 180px;
    height: 180px;
    border-radius: 8px;
    object-fit: cover;
    border: 3px solid var(--mls-accent, #737d5d);
}

.agent-photo .placeholder-photo {
    width: 180px;
    height: 180px;
    border-radius: 8px;
    background: var(--mls-grey-green, #c5d3b6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    color: #fff;
}

.agent-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.agent-main-info {
    flex: 1;
}

.agent-info h1 {
    margin: 0 0 8px 0;
    font-size: 28px;
    color: var(--mls-dark, #3a4034);
    font-weight: 600;
}

.agent-license {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--mls-accent, #737d5d);
    color: #fff;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 12px;
}

.agent-rating {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
}

.agent-rating .stars {
    display: flex;
    gap: 2px;
}

.agent-rating .star {
    color: #ffa500;
    font-size: 18px;
}

.agent-rating .star.filled {
    color: #ffa500;
}

.agent-rating .star:not(.filled) {
    color: #e0e0e0;
}

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

.agent-meta-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    font-size: 14px;
    color: #666;
}

.agent-meta-details p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.agent-contact {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-methods h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 0.5px;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    color: var(--mls-dark, #3a4034);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.3s;
    font-family: inherit;
}

.contact-link:hover {
    color: var(--mls-accent, #737d5d);
}

.contact-link .dashicons {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    font-size: 18px;
}

.rating-action {
    margin-top: 8px;
}

.btn-rate-agent {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #ffa500;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-rate-agent:hover {
    background: #ff8c00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 165, 0, 0.3);
}

.btn-rate-agent:active {
    transform: translateY(0);
}

/* Contact Section */
.agent-contact {
    background: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
    box-shadow: none;
}

.agent-contact h2 {
    margin: 0 0 20px 0;
    font-size: 22px;
    color: var(--mls-dark, #3a4034);
}

.contact-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.contact-btn {
    flex: 1;
    min-width: 150px;
    padding: 12px 20px;
    border-radius: 6px;
    text-decoration: none;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.contact-btn.phone {
    background: var(--mls-accent, #737d5d);
    color: #fff;
}

.contact-btn.whatsapp {
    background: #25D366;
    color: #fff;
}

.contact-btn.email {
    background: var(--mls-grey-green, #c5d3b6);
    color: var(--mls-dark, #3a4034);
}

.contact-btn.message {
    background: var(--mls-dark, #3a4034);
    color: #fff;
}

.contact-btn.rate-agent {
    background: #ffa500;
    color: #fff;
    border: none;
}

.contact-btn.rate-agent:hover {
    background: #ff8c00;
}

.contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Rate Notice */
.rate-notice {
    padding: 12px 16px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    color: #856404;
    font-size: 14px;
    margin-bottom: 20px;
}

/* Stats Bar */
.agent-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    color: var(--mls-accent, #737d5d);
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

/* Bio and Specialties */
.agent-bio,
.agent-specialties,
.agent-listings,
.agent-reviews {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.agent-bio h2,
.agent-specialties h2,
.agent-listings h2,
.agent-reviews h2 {
    margin: 0 0 20px 0;
    font-size: 22px;
    color: var(--mls-dark, #3a4034);
}

.bio-text {
    line-height: 1.8;
    color: #444;
}

.specialties-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.specialty-tag {
    padding: 8px 16px;
    background: var(--mls-grey-green, #c5d3b6);
    color: var(--mls-dark, #3a4034);
    border-radius: 20px;
    font-size: 14px;
}

/* Listings Grid */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.property-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.property-card:hover {
    transform: translateY(-5px);
}

.property-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    position: relative;
}

/* Add status badge positioning for property images */
.property-image .status-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 7px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #ffffff;
    border-radius: 5px;
    z-index: 3;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.property-details {
    padding: 15px;
}

.property-title {
    margin: 0 0 10px 0;
    font-size: 16px;
}

.property-title a {
    color: var(--mls-dark, #3a4034);
    text-decoration: none;
}

.property-price {
    color: var(--mls-accent, #737d5d);
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 10px;
}

.property-meta {
    display: flex;
    gap: 15px;
    color: #666;
    font-size: 13px;
}

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

.write-review-btn {
    background: var(--mls-accent, #737d5d);
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.write-review-btn:hover {
    background: var(--mls-dark, #3a4034);
}

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

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

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

.reviewer-avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

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

.review-date {
    color: #999;
    font-size: 13px;
}

.review-rating {
    color: #ffa500;
    margin-bottom: 10px;
}

.review-comment {
    line-height: 1.6;
    color: #444;
}

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

/* Review Modal */
.review-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.review-modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 22px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
}

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

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

.modal-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--mls-dark, #3a4034);
}

.star-rating {
    display: flex;
    gap: 5px;
    font-size: 30px;
    margin-bottom: 10px;
}

.star-rating .star {
    cursor: pointer;
    color: #ddd;
    transition: color 0.2s;
}

.star-rating .star.active,
.star-rating .star:hover {
    color: #ffa500;
}

.modal-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.submit-review-btn {
    width: 100%;
    padding: 12px;
    background: var(--mls-accent, #737d5d);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.submit-review-btn:hover {
    background: var(--mls-dark, #3a4034);
}

/* ==================================
   REVIEW MODAL STYLES
   ================================== */
.malisafi-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

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

.malisafi-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.malisafi-modal .modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1;
    animation: slideUp 0.3s ease;
}

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

.malisafi-modal .modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
    background: none;
    border: none;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.malisafi-modal h2 {
    margin: 0 0 30px 0;
    font-size: 28px;
    color: var(--mls-dark, #3a4034);
}

.malisafi-modal .form-group {
    margin-bottom: 24px;
}

.malisafi-modal .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--mls-dark, #3a4034);
    font-size: 15px;
}

.malisafi-modal .form-group input[type="text"],
.malisafi-modal .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s;
}

.malisafi-modal .form-group input[type="text"]:focus,
.malisafi-modal .form-group textarea:focus {
    outline: none;
    border-color: var(--mls-accent, #737d5d);
    box-shadow: 0 0 0 3px rgba(115, 125, 93, 0.1);
}

.malisafi-modal .form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.malisafi-modal .char-count {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #999;
    text-align: right;
}

.malisafi-modal .char-count .current {
    color: var(--mls-accent, #737d5d);
    font-weight: 600;
}

/* Star Rating Input */
.star-rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 8px;
    font-size: 40px;
    line-height: 1;
}

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

.star-rating-input .star {
    cursor: pointer;
    color: #ddd;
    transition: all 0.2s;
    user-select: none;
}

.star-rating-input .star:hover,
.star-rating-input .star.active {
    color: #ffa500;
    transform: scale(1.1);
}

.star-rating-input:hover .star:hover ~ .star {
    color: #ffa500;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    justify-content: flex-end;
}

.form-actions .button {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.form-actions .cancel-review {
    background: #f5f5f5;
    color: #666;
    border-color: #e0e0e0;
}

.form-actions .cancel-review:hover {
    background: #e0e0e0;
}

.form-actions .submit-rating {
    background: var(--mls-accent, #737d5d);
    color: #fff;
}

.form-actions .submit-rating:hover {
    background: var(--mls-dark, #3a4034);
}

.form-actions .submit-rating:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==================================
   REVIEW DISPLAY STYLES
   ================================== */
.review-item {
    border-bottom: 1px solid #e0e0e0;
    padding: 20px 0;
}

.review-item:last-child {
    border-bottom: none;
}

.review-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--mls-dark, #3a4034);
    margin: 12px 0 8px;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #28a745;
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

.verified-badge .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Helpful Votes */
.review-helpful {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.review-helpful .helpful-label {
    font-size: 14px;
    color: #666;
}

.helpful-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.helpful-btn:hover:not(:disabled) {
    background: var(--mls-grey-green, #c5d3b6);
    border-color: var(--mls-accent, #737d5d);
    color: var(--mls-dark, #3a4034);
}

.helpful-btn:disabled,
.helpful-btn.voted {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.helpful-btn .helpful-yes-count,
.helpful-btn .helpful-no-count {
    font-weight: 600;
    color: var(--mls-accent, #737d5d);
}

/* Agent Response */
.agent-response {
    background: #f9f9f9;
    border-left: 4px solid var(--mls-accent, #737d5d);
    padding: 16px;
    margin-top: 16px;
    border-radius: 6px;
}

.agent-response .response-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--mls-accent, #737d5d);
    font-size: 14px;
}

.agent-response .response-header .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.agent-response .response-date {
    color: #999;
    font-weight: normal;
    margin-left: auto;
}

.agent-response p {
    margin: 0;
    color: #555;
    line-height: 1.6;
}

/* ==================================
   NOTIFICATION MESSAGES
   ================================== */
.malisafi-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    padding: 16px 20px;
    max-width: 400px;
    z-index: 1000000;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.malisafi-message-success {
    border-left: 4px solid #28a745;
}

.malisafi-message-error {
    border-left: 4px solid #dc3545;
}

.malisafi-message .message-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.malisafi-message-success .message-icon {
    color: #28a745;
}

.malisafi-message-error .message-icon {
    color: #dc3545;
}

.malisafi-message .message-text {
    flex: 1;
    font-size: 15px;
    color: #333;
}

.malisafi-message .message-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.malisafi-message .message-close:hover {
    color: #333;
}

/* Loading animation for dashicons-update */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.dashicons.spin {
    animation: spin 1s linear infinite;
}

/* Message Boxes */
.message-box {
    padding: 12px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: none;
}

.message-box.active {
    display: block;
}

.message-box.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-box.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive */
@media (max-width: 768px) {
    .agent-header {
        flex-direction: column;
        text-align: center;
    }
    
    .contact-buttons {
        flex-direction: column;
    }
    
    .contact-btn {
        min-width: 100%;
    }
    
    .agent-stats {
        grid-template-columns: 1fr;
    }
    
    .properties-grid {
        grid-template-columns: 1fr;
    }
    
    .malisafi-modal .modal-content {
        padding: 30px 20px;
        max-width: 95%;
    }
    
    .star-rating-input {
        font-size: 32px;
    }
    
    .malisafi-message {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .review-helpful {
        flex-wrap: wrap;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    .form-actions .button {
        width: 100%;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .agent-header {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .agent-photo img,
    .agent-photo .placeholder-photo {
        width: 140px;
        height: 140px;
    }

    .agent-info {
        gap: 12px;
    }

    .agent-main-info h1 {
        font-size: 24px;
    }

    .contact-links {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .contact-link {
        flex: 1 1 calc(50% - 4px);
        min-width: 120px;
        padding: 8px 12px;
        font-size: 12px;
    }

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

    .rating-action {
        width: 100%;
    }

    .btn-rate-agent {
        width: 100%;
        justify-content: center;
    }

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

    .malisafi-modal .modal-content {
        padding: 20px;
    }

    .malisafi-modal h2 {
        font-size: 24px;
    }

    .star-rating-input {
        font-size: 32px;
    }

    .form-actions {
        flex-direction: column;
        gap: 10px;
    }

    .form-actions .button {
        width: 100%;
    }
