:root {
    --ptp-primary: #6366f1;
    --ptp-primary-hover: #4f46e5;
    --ptp-bg-glass: rgba(255, 255, 255, 0.1);
    --ptp-border-glass: rgba(255, 255, 255, 0.2);
    --ptp-text-main: #1f2937;
    --ptp-text-muted: #6b7280;
    --ptp-star-color: #f59e0b;
    --ptp-card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

/* Glassmorphism Effect */
.glass-effect {
    background: var(--ptp-bg-glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--ptp-border-glass);
    border-radius: 20px;
}

/* Form Styling */
.ptp-form-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 40px;
    box-shadow: var(--ptp-card-shadow);
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.4) 100%);
}

.ptp-form-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 2rem;
    text-align: center;
    margin-bottom: 30px;
    background: linear-gradient(to right, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.ptp-form-group input, 
.ptp-form-group textarea {
    width: 100%;
    padding: 15px 20px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: rgba(255,255,255,0.9);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.ptp-form-group input:focus, 
.ptp-form-group textarea:focus {
    outline: none;
    border-color: var(--ptp-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Star Rating Input */
.rating-selection {
    text-align: center;
    margin: 25px 0;
}

.ptp-stars {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
}

.ptp-star {
    color: #d1d5db;
    transition: color 0.2s ease, transform 0.2s ease;
}

.ptp-star:hover,
.ptp-star:hover ~ .ptp-star,
.ptp-star.active,
.ptp-star.active ~ .ptp-star {
    color: var(--ptp-star-color);
    transform: scale(1.1);
}

.ptp-submit-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(to right, #6366f1, #a855f7);
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ptp-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

/* Grid Display */
.ptp-testimonial-grid {
    display: grid;
    gap: 30px;
    padding: 10px;
    max-width: 1600px;
    margin: 0 auto;
}

.ptp-cols-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.ptp-cols-2 { grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); }

.ptp-card {
    padding: 30px;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.ptp-white-bg {
    background: white !important;
    border: 1px solid #f3f4f6 !important;
}

.ptp-has-shadow {
    box-shadow: var(--ptp-card-shadow) !important;
}

.ptp-card:hover {
    transform: translateY(-10px);
}

/* Card Header with Avatar */
.ptp-card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.ptp-avatar {
    width: 70px !important;
    height: 70px !important;
    min-width: 70px;
    min-height: 70px;
    max-width: 70px;
    max-height: 70px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.ptp-avatar-default {
    background: #6b6b6b;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ptp-avatar-default svg {
    width: 50px;
    height: 50px;
    margin-top: 6px;
}

.ptp-user-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0;
    color: var(--ptp-text-main);
}

.ptp-user-pos {
    font-size: 0.85rem;
    color: var(--ptp-text-muted);
    margin: 0;
}

.ptp-rating-display {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    gap: 2px;
}

.ptp-star-icon {
    color: #e5e7eb;
    font-size: 1.2rem;
}

.ptp-star-icon.filled {
    color: var(--ptp-star-color);
}

/* Card Body & Review Text */
.ptp-card-body {
    line-height: 1.6;
    font-size: 0.95rem;
}

.ptp-review-text {
    margin-bottom: 12px;
    color: var(--ptp-text-muted);
}

/* Review Gallery - Small Square Thumbnails */
.ptp-review-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    justify-content: center;
}

.ptp-review-thumb {
    width: 65px;
    height: 65px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.06);
    flex-shrink: 0;
}

.ptp-review-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.ptp-review-thumb:hover img {
    transform: scale(1.1);
}

/* Image Only Styles */
.ptp-card.ptp-image-only {
    padding: 20px !important;
}

.ptp-card.ptp-image-only .ptp-card-body .ptp-review-gallery {
    margin-top: 0 !important;
    gap: 14px !important;
}

/* 3x lipat lebih besar dari thumbnail biasa (65px × 3 ≈ 195px) — specificity tinggi + !important fallback */
.ptp-card.ptp-image-only .ptp-card-body .ptp-review-gallery .ptp-review-thumb {
    width: 195px !important;
    height: 195px !important;
    max-width: 195px !important;
    max-height: 195px !important;
    min-width: 195px !important;
    min-height: 195px !important;
    border-radius: 12px !important;
    flex-shrink: 0 !important;
}

.ptp-card.ptp-image-only .ptp-card-body .ptp-review-gallery .ptp-review-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.3s ease !important;
}

.ptp-card.ptp-image-only .ptp-card-body .ptp-review-gallery .ptp-review-thumb:hover img {
    transform: scale(1.05) !important;
}

/* Mobile Layout — MEPET TOTAL ke tepi kiri-kanan layar */
@media (max-width: 768px) {
    .ptp-testimonial-grid {
        padding: 0 !important;
        gap: 14px !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .ptp-cols-3,
    .ptp-cols-2 {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }

    .ptp-card {
        padding: 18px !important;
    }

    .ptp-card.ptp-image-only {
        padding: 10px !important;
    }

    .ptp-card.ptp-image-only .ptp-card-body .ptp-review-gallery {
        gap: 8px !important;
    }

    .ptp-card.ptp-image-only .ptp-card-body .ptp-review-gallery .ptp-review-thumb {
        width: 46vw !important;
        height: 46vw !important;
        max-width: 46vw !important;
        max-height: 46vw !important;
        min-width: 46vw !important;
        min-height: 46vw !important;
    }
}

@media (max-width: 480px) {
    .ptp-testimonial-grid {
        padding: 0 !important;
        gap: 10px !important;
    }

    .ptp-cols-3,
    .ptp-cols-2 {
        grid-template-columns: 1fr;
    }

    .ptp-card {
        padding: 14px !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }

    .ptp-card.ptp-image-only {
        padding: 8px !important;
        border-radius: 0 !important;
    }

    .ptp-card.ptp-image-only .ptp-card-body .ptp-review-gallery .ptp-review-thumb {
        width: 48vw !important;
        height: 48vw !important;
        max-width: 48vw !important;
        max-height: 48vw !important;
        min-width: 48vw !important;
        min-height: 48vw !important;
        border-radius: 10px !important;
    }
}

/* Form Message */
#ptp-form-message {
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
    padding: 10px;
    border-radius: 8px;
}

#ptp-form-message.success {
    background: #ecfdf5;
    color: #059669;
}

#ptp-form-message.error {
    background: #fef2f2;
    color: #dc2626;
}

/* Pop Up Review Image Styles */
[data-ptp-popup="1"] .ptp-review-image-item {
    cursor: zoom-in;
}

.ptp-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.ptp-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ptp-popup-close {
    position: absolute;
    top: 20px;
    right: 25px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.ptp-popup-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

.ptp-popup-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.ptp-popup-overlay.active .ptp-popup-content {
    transform: scale(1);
}

.ptp-popup-content img {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

.ptp-popup-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: none;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    backdrop-filter: blur(4px);
    z-index: 2;
}

.ptp-popup-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ptp-popup-nav.prev {
    left: 20px;
}

.ptp-popup-nav.next {
    right: 20px;
}

.ptp-popup-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.ptp-popup-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ptp-spin 0.8s linear infinite;
    display: none;
}

.ptp-popup-loader.active {
    display: block;
}

@keyframes ptp-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Image Only Mode — Popup tidak fullscreen */
.ptp-popup-overlay.ptp-popup-type-image-only {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.ptp-popup-overlay.ptp-popup-type-image-only .ptp-popup-content {
    max-width: 480px;
    max-height: 80vh;
}

.ptp-popup-overlay.ptp-popup-type-image-only .ptp-popup-content img {
    max-height: 80vh;
    border-radius: 16px;
}

.ptp-popup-overlay.ptp-popup-type-image-only .ptp-popup-close {
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    font-size: 22px;
}

.ptp-popup-overlay.ptp-popup-type-image-only .ptp-popup-nav {
    width: 40px;
    height: 40px;
    font-size: 18px;
}

.ptp-popup-overlay.ptp-popup-type-image-only .ptp-popup-nav.prev {
    left: calc(50% - 480px / 2 - 60px);
}

.ptp-popup-overlay.ptp-popup-type-image-only .ptp-popup-nav.next {
    right: calc(50% - 480px / 2 - 60px);
}

@media (max-width: 640px) {
    .ptp-popup-overlay.ptp-popup-type-image-only .ptp-popup-content {
        max-width: 90vw;
    }
    .ptp-popup-overlay.ptp-popup-type-image-only .ptp-popup-nav.prev {
        left: 10px;
    }
    .ptp-popup-overlay.ptp-popup-type-image-only .ptp-popup-nav.next {
        right: 10px;
    }
}
