/**
 * Expert Testimonials Styles
 */

/* Expert card wrapper - takes same width as card-box would */
.gallery-cards .inner-cards .expert-card-wrapper {
    width: calc(33.33% - 21.3px);
    position: relative;
}

@media (max-width: 1200px) {
    .gallery-cards .inner-cards .expert-card-wrapper {
        width: calc(50% - 16px);
    }
}

@media (max-width: 767.98px) {
    .gallery-cards .inner-cards .expert-card-wrapper {
        width: 100%;
    }
}

.expert-card-wrapper {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.expert-card-wrapper > .card-box {
    margin-bottom: 0;
    width: 100% !important;
    border: none;
    border-radius: 0;
    box-shadow: none;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.expert-card-wrapper > .card-box .learn-more-btn {
    display: none !important;
}

/* Testimonial section under card */
.expert-testimonial-section {
    background: #f8f9fa;
    border-top: 1px solid #e5e7eb;
    border-radius: 0;
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.testimonial-status {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.status-verified {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.status-archived {
    background: #f3f4f6;
    color: #6b7280;
}

.testimonial-rating .star {
    display: inline-block;
}

.testimonial-rating .star.filled svg,
.testimonial-rating .star.filled path,
.testimonial-rating .star.filled polygon {
    fill: #f59e0b !important;
    stroke: #f59e0b !important;
}

.helpful-count {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #6b7280;
}

.testimonial-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.testimonial-actions button,
.btn-leave-testimonial,
.btn-new-testimonial {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.testimonial-actions button:hover,
.btn-leave-testimonial:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.btn-leave-testimonial {
    background: #96ff94;
    border-color: #96ff94;
    color: #04132D;
}

.btn-leave-testimonial:hover {
    background: #7de87b;
    border-color: #7de87b;
}

.btn-delete-testimonial {
    color: #dc2626;
}

.btn-delete-testimonial:hover {
    background: #fef2f2;
    border-color: #fecaca;
}

/* My Testimonials Section */
.my-testimonials-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #e5e7eb;
}

.my-testimonials-section .section-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: 1px;
}

.testimonials-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

.testimonial-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
}

.testimonial-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.expert-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.expert-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

.expert-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.expert-name {
    font-weight: 600;
    color: #04132D;
    text-decoration: none;
}

.expert-name:hover {
    text-decoration: underline;
}

.services-used {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.service-tag {
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: #4b5563;
}

.service-type {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
}

.testimonial-text {
    margin-bottom: 12px;
    line-height: 1.6;
}

.testimonial-text p {
    margin: 0;
}

.testimonial-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
    margin-bottom: 12px;
}

.testimonial-date {
    font-size: 12px;
    color: #9ca3af;
}

.no-testimonials {
    color: #6b7280;
    font-style: italic;
    margin-bottom: 20px;
}

.btn-new-testimonial {
    background: #04132D;
    color: white;
    border-color: #04132D;
    padding: 12px 24px;
    font-size: 14px;
}

.btn-new-testimonial:hover {
    background: #1a2744;
    border-color: #1a2744;
}

/* Modal: body lock */
body.modal-open,
html.modal-open {
    overflow: hidden !important;
    height: 100% !important;
}

/* Modal Styles */
.testimonial-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: auto;
    scrollbar-color: rgba(255,255,255,0.6) rgba(0,0,0,0.3);
}

.testimonial-modal::-webkit-scrollbar {
    width: 14px;
}

.testimonial-modal::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.testimonial-modal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 7px;
    border: 3px solid rgba(0, 0, 0, 0.3);
}

.testimonial-modal::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.8);
}

.testimonial-modal-scroll-wrapper {
    padding: 100px 20px 40px;
    box-sizing: border-box;
}

.testimonial-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 1000px;
    margin: 0 auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.testimonial-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.testimonial-modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    letter-spacing: 1px;
}

.testimonial-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.testimonial-modal-close:hover {
    color: #4b5563;
}

#testimonial-form {
    padding: 24px;
}

/* 2-column layout on desktop */
@media (min-width: 1024px) {
    .testimonial-modal-scroll-wrapper {
        padding: 80px 20px 30px;
    }

    .testimonial-modal-content .modal-columns {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }

    .testimonial-modal-content .modal-col-left,
    .testimonial-modal-content .modal-col-right {
        min-width: 0;
    }

    .testimonial-modal-content .modal-col-right textarea {
        min-height: 200px;
    }
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group label .required {
    color: #dc2626;
}

.field-description {
    font-size: 12px;
    color: #6b7280;
    margin: 0 0 8px 0;
}

.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #96ff94;
    box-shadow: 0 0 0 3px rgba(150, 255, 148, 0.2);
}

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

.char-count {
    font-size: 12px;
    color: #9ca3af;
    text-align: right;
    margin-top: 4px;
}

.char-count .over-limit {
    color: #dc2626;
    font-weight: 600;
}

/* Services dropdown */
.services-dropdown-container {
    position: relative;
}

.services-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    transition: all 0.2s;
}

.services-dropdown-trigger:hover {
    border-color: #9ca3af;
}

.services-dropdown-trigger.open {
    border-color: #96ff94;
    box-shadow: 0 0 0 2px rgba(150, 255, 148, 0.2);
}

.services-dropdown-trigger svg {
    transition: transform 0.2s;
    flex-shrink: 0;
}

.services-dropdown-trigger.open svg {
    transform: rotate(180deg);
}

.selected-services-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 8px;
}

.services-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: 4px;
    max-height: 250px;
    overflow-y: auto;
    display: none;
}

.services-dropdown-menu.open {
    display: block;
}

/* Services checkboxes inside dropdown */
.services-checkboxes {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
}

.checkbox-option:hover {
    background: #f3f4f6;
}

.checkbox-option input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #96ff94;
    flex-shrink: 0;
}

.checkbox-option span {
    flex: 1;
}

.checkbox-option input:checked + span {
    font-weight: 600;
    color: #04132D;
}

.checkbox-option:has(input:checked) {
    background: #e8fff0;
    border-left: 3px solid #96ff94;
}

/* Fallback for browsers without :has() - JS adds .checked class */
.checkbox-option.checked {
    background: #e8fff0;
    border-left: 3px solid #96ff94;
}

/* Service type radio */
.service-type-options {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 16px;
    background: #f3f4f6;
    border: 2px solid transparent;
    border-radius: 6px;
    transition: all 0.2s;
}

.radio-option:hover {
    background: #e5e7eb;
}

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

.radio-option input[type="radio"]:checked + span {
    font-weight: 600;
}

.radio-option:has(input:checked) {
    background: #96ff94;
    border: 2px solid #04132D;
    font-weight: 600;
}

/* Fallback for browsers without :has() - JS will add .selected class */
.radio-option.selected {
    background: #96ff94;
    border: 2px solid #04132D;
    font-weight: 600;
}

/* Star rating input */
.star-rating-input {
    display: flex;
    gap: 4px;
}

.star-rating-input .star-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.1s;
}

.star-rating-input .star-btn:hover {
    transform: scale(1.1);
}

/* Existing photos */
.existing-photos {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.existing-photo {
    position: relative;
    width: 80px;
    height: 80px;
}

.existing-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.existing-photo .remove-photo {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Form actions */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.btn-cancel {
    padding: 12px 24px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.btn-cancel:hover {
    background: #f3f4f6;
}

.btn-submit {
    padding: 12px 24px;
    background: #96ff94;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: #04132D;
}

.btn-submit:hover {
    background: #7de87b;
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Expert page testimonials */
.expert-testimonials-section {
    padding: 60px 0;
    background: #f8f9fa;
}

.expert-testimonials-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.expert-testimonials-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.expert-testimonials-section .section-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    letter-spacing: 1px;
}

/* Login button to leave testimonial */
.btn-login-testimonial {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #96ff94;
    border: none;
    border-radius: 8px;
    color: #04132D;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    margin-top: 12px;
}

.btn-login-testimonial:hover {
    background: #7de87b;
    text-decoration: none;
    color: #04132D;
}

.btn-login-testimonial svg {
    flex-shrink: 0;
}

.expert-testimonials-section .rating-summary {
    display: flex;
    align-items: center;
    gap: 12px;
}

.expert-testimonials-section .average-rating {
    font-size: 36px;
    font-weight: 700;
    color: #04132D;
}

.expert-testimonials-section .rating-stars {
    display: flex;
    gap: 4px;
}

.expert-testimonials-section .rating-count {
    font-size: 14px;
    color: #6b7280;
}

/* Sort bar */
.testimonials-sort {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.testimonials-sort label {
    font-size: 14px;
    color: #6b7280;
    white-space: nowrap;
    flex-shrink: 0;
}

.testimonials-sort select {
    padding: 8px 32px 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #04132D;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 10px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}

.testimonials-sort select:focus {
    outline: none;
    border-color: #04132D;
}

.expert-testimonials-section .testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

.expert-testimonials-section .testimonial-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.expert-testimonials-section .testimonial-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.expert-testimonials-section .user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.expert-testimonials-section .user-info {
    flex: 1;
}

.expert-testimonials-section .user-name {
    font-weight: 600;
    color: #04132D;
    text-decoration: none;
}

.expert-testimonials-section .user-name:hover {
    text-decoration: underline;
}

.expert-testimonials-section .testimonial-meta {
    font-size: 12px;
    color: #6b7280;
}

.expert-testimonials-section .testimonial-services {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.expert-testimonials-section .testimonial-content {
    margin-bottom: 16px;
    line-height: 1.6;
}

.expert-testimonials-section .testimonial-photos {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.expert-testimonials-section .testimonial-photo {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
}

.expert-testimonials-section .testimonial-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.expert-testimonials-section .like-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.expert-testimonials-section .like-btn:hover {
    background: #f3f4f6;
}

.expert-testimonials-section .like-btn.liked {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.expert-testimonials-section .no-testimonials {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.expert-testimonials-section .title-area {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Responsive */
@media (max-width: 768px) {
    .testimonial-modal-scroll-wrapper {
        padding: 80px 10px 40px;
    }
    
    .testimonial-modal-content {
        max-width: 100%;
        border-radius: 12px 12px 0 0;
    }

    .testimonial-modal-content .modal-columns {
        display: block;
    }
    
    .expert-testimonial-section {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .testimonial-actions {
        margin-left: 0;
        width: 100%;
    }
    
    .testimonial-actions button {
        flex: 1;
        justify-content: center;
    }
    
    .testimonial-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .expert-testimonials-section .testimonials-grid {
        grid-template-columns: 1fr;
    }
    
    .service-type-options {
        flex-direction: column;
    }
}
