/* =====================================================
   Judge.me Style Reviews Widget - Main Styles
   ===================================================== */

:root {
    --jdgm-primary: #FF6600;
    --jdgm-text: #000;
    --jdgm-text-light: #000;
    --jdgm-border: #DDDDDD;
    --jdgm-bg: #FFFFFF;
    --jdgm-bg-light: #FAFAFA;
    --jdgm-button-bg: #FF6600;
    --jdgm-button-hover: #FF6600;
}

/* =====================================================
   Base Container
   ===================================================== */

.jdgm-legacy-widget-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--jdgm-text);
}

.jdgm-rev-widg {
    margin: 0;
    padding: 0;
}

.jdgm-rev-widg * {
    box-sizing: border-box;
}

/* =====================================================
   Header Section
   ===================================================== */

.jdgm-rev-widg__header {
    padding: 24px 0;
    border-bottom: 1px solid var(--jdgm-border);
    margin-bottom: 24px;
}

.jdgm-rev-widg__title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 24px 0;
    color: var(--jdgm-text);
    letter-spacing: -0.5px;
}

.jdgm-row-stars {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
}

/* =====================================================
   Summary Stars
   ===================================================== */

.jdgm-rev-widg__summary {
    flex: 1;
    min-width: 250px;
}

.jdgm-rev-widg__summary-inner {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.jdgm-rev-widg__summary-stars {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 20px;
}

.jdgm-star {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23DDDDDD" stroke-width="2"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>') no-repeat center;
    background-size: contain;
}

.jdgm-star.jdgm--on {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23FF6600"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>') no-repeat center;
    background-size: contain;
}

.jdgm-rev-widg__summary-average {
    font-weight: 600;
    font-size: 18px;
    margin-left: 8px;
}

.jdgm-rev-widg__summary-text {
    font-size: 14px;
    color: var(--jdgm-text-light);
}

/* =====================================================
   Action Buttons
   ===================================================== */

.jdgm-widget-actions-wrapper {
    display: flex;
    gap: 12px;
}

.jdgm-write-rev-link {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--jdgm-primary);
    color: #FFFFFF;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease;
    border: none;
}

.jdgm-write-rev-link:hover {
    background-color: #000;
    color: #fff;
    transform: translateY(-1px);
}

.jdgm-write-rev-link:active {
    transform: translateY(0);
}

/* =====================================================
   Review Form
   ===================================================== */

.jdgm-form-wrapper {
    margin-bottom: 32px;
    padding: 32px;
    background-image: linear-gradient(rgb(255, 247, 240) 0%, rgb(255, 255, 255) 100%);
    border-radius: 12;
    border: 0.8px solid rgba(255, 96, 0, 0.14);
}

.jdgm-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 600px;
    margin: 0 auto;
}

.jdgm-form__title {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    
    text-align: center;
    color: var(--jdgm-text);
}

.jdgm-form__fieldset {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.jdgm-form__fieldset label {
    font-size: 14px;
    font-weight: 600;
    color: var(--jdgm-text);
    text-transform: capitalize;
}

.jdgm-form__fieldset input[type="text"],
.jdgm-form__fieldset input[type="email"],
.jdgm-form__fieldset select {
    padding: 12px 14px;
    border: 1px solid var(--jdgm-border);
    border-radius: 50px;
    font-size: 14px;
    font-family: inherit;
    background-color: #FFFFFF;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    color: var(--jdgm-text);
}

.jdgm-form__fieldset textarea{
 padding: 12px 14px;
    border: 1px solid var(--jdgm-border);
    border-radius: 24px;
    font-size: 14px;
    font-family: inherit;
    background-color: #FFFFFF;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    color: var(--jdgm-text);
}

.jdgm-form__fieldset input[type="text"]::placeholder,
.jdgm-form__fieldset input[type="email"]::placeholder,
.jdgm-form__fieldset textarea::placeholder {
    color: #CCCCCC;
}

.jdgm-form__fieldset input[type="text"]:focus,
.jdgm-form__fieldset input[type="email"]:focus,
.jdgm-form__fieldset textarea:focus,
.jdgm-form__fieldset select:focus {
    outline: none;
    border-color: var(--jdgm-primary);
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.08);
}

.jdgm-form__fieldset textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

/* Rating Stars in Form */

.jdgm-form__rating {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 28px;
    color: #ff6600;
    justify-content: center;
}

.jdgm-form__rating .jdgm-star {
    cursor: pointer;
    color: #ff6600;
    transition: transform 0.15s ease;
    width: 28px;
    height: 28px;
}

.jdgm-form__rating .jdgm-star:hover {
    transform: scale(1.15);
}

/* Media Upload Field */

.jdgm-media-fieldset__container {
    display: flex;
    justify-content: center;
    margin: 10px 0;
}

.jdgm-picture-fieldset__box {
    position: relative;
    width: 100%;
    max-width: 300px;
}

.jdgm-picture-fieldset__box--input {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--jdgm-border);
    border-radius: 4px;
    padding: 40px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #FAFAFA;
}

.jdgm-picture-fieldset__box--input:hover {
    border-color: var(--jdgm-primary);
    background-color: rgba(255, 102, 0, 0.02);
}

.jdgm-picture-fieldset__box-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.jdgm-media-fieldset__icon {
    font-size: 32px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jdgm-media-fieldset__input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Form Buttons */

.jdgm-form__fieldset-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    justify-content: center;
}

.jdgm-btn {
    padding: 12px 32px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    text-decoration: none;
    display: inline-block;
}

.jdgm-btn--solid {
    background-color: var(--jdgm-button-bg);
    color: #FFFFFF;
    border-color: var(--jdgm-button-bg);
}

.jdgm-btn--solid:hover {
    background-color: var(--jdgm-button-hover);
    border-color: var(--jdgm-button-hover);
    transform: translateY(-2px);
}

.jdgm-btn--border {
    background-color: transparent;
    color: var(--jdgm-button-bg);
    border-color: var(--jdgm-button-bg);
}

.jdgm-btn--border:hover {
    background-color: var(--jdgm-button-bg);
    color: #FFFFFF;
}

/* =====================================================
   Photo Gallery
   ===================================================== */

.jdgm-row-media {
    margin: 32px 0;
    padding: 24px 0;
    border-bottom: 1px solid var(--jdgm-border);
}

.jdgm-gallery-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.jdgm-gallery-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--jdgm-text);
}

.jdgm-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.jdgm-gallery__thumbnail-link {
    display: block;
    cursor: pointer;
}

.jdgm-gallery__thumbnail-wrapper {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    background-color: var(--jdgm-bg-light);
}

.jdgm-gallery__thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.jdgm-gallery__thumbnail:hover {
    transform: scale(1.05);
}

/* =====================================================
   Sort & Actions
   ===================================================== */

.jdgm-row-actions {
    margin-bottom: 32px;
}

.jdgm-rev-widg__sort-wrapper {
    display: flex;
    justify-content: flex-end;
}

.jdgm-sort-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.jdgm-sort-dropdown {
    padding: 10px 36px 10px 12px;
    border: 1px solid var(--jdgm-border);
    border-radius: 4px;
    font-size: 14px;
    background-color: #FFFFFF;
    cursor: pointer;
    appearance: none;
    min-width: 180px;
}

.jdgm-sort-dropdown:focus {
    outline: none;
    border-color: var(--jdgm-primary);
    box-shadow: 0 0 0 3px rgba(255, 184, 0, 0.1);
}

.jdgm-sort-dropdown-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    width: 12px;
    height: 8px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 8"><path d="M1 1l5 5 5-5" stroke="%23333" stroke-width="1.5" fill="none"/></svg>') no-repeat;
    background-size: contain;
}

/* =====================================================
   Reviews Container
   ===================================================== */

.jdgm-rev-widg__body {
    padding: 0;
}

.jdgm-rev-widg__reviews {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.jdgm-no-reviews {
    text-align: center;
    padding: 40px 20px;
    color: var(--jdgm-text-light);
    font-size: 14px;
}

/* =====================================================
   Individual Review Card
   ===================================================== */

.jdgm-rev {
    padding: 24px 0;
    border-top: 1px solid var(--jdgm-border);
    transition: background-color 0.2s ease;
}

.jdgm-rev:hover {
    background-color: rgba(255, 184, 0, 0.02);
}

.jdgm-divider-top {
    border-top: 1px solid var(--jdgm-border);
}

/* Review Header */

.jdgm-rev__header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
    align-items: flex-start;
}

.jdgm-row-rating {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.jdgm-rev__rating {
    display: flex;
    gap: 2px;
    align-items: center;
    font-size: 16px;
}

.jdgm-rev__rating .jdgm-star {
    width: 16px;
    height: 16px;
}

.jdgm-rev__timestamp {
    font-size: 13px;
    color: var(--jdgm-text-light);
    margin-left: auto;
}

/* Review Profile */

.jdgm-row-profile {
    width: 100%;
}

.jdgm-rev__author-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.jdgm-rev__author {
    font-weight: 600;
    font-size: 14px;
    color: var(--jdgm-text);
}

.jdgm-rev__buyer-badge {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2327AE60"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>') no-repeat center;
    background-size: contain;
    title: "Verified Buyer";
}

/* Review Content */

.jdgm-rev__content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.jdgm-rev__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--jdgm-text);
    margin: 0;
    display: block;
}

.jdgm-rev__body {
    font-size: 14px;
    line-height: 1.6;
    color: var(--jdgm-text);
    margin: 0;
    word-break: break-word;
}

.jdgm-rev__body p {
    margin: 0;
}

.jdgm-rev__body p + p {
    margin-top: 8px;
}

/* Media in Reviews */

.jdgm-rev__pics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.jdgm-rev__pic-link {
    display: block;
    overflow: hidden;
    border-radius: 6px;
    background-color: var(--jdgm-bg-light);
}

.jdgm-rev__pic-img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    transition: transform 0.2s ease;
    display: block;
}

.jdgm-rev__pic-link:hover .jdgm-rev__pic-img {
    transform: scale(1.05);
}

/* Transparency Badge */

.jdgm-rev__transparency-badge-wrapper {
    margin-top: 8px;
}

.jdgm-rev__transparency-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--jdgm-border);
    font-size: 12px;
    color: var(--jdgm-text-light);
    background-color: var(--jdgm-bg-light);
}

/* Review Actions */

.jdgm-rev__actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
}

.jdgm-rev__votes {
    display: flex;
    gap: 8px;
}

.jdgm-rev__vote-button {
    padding: 6px 12px;
    border: 1px solid var(--jdgm-border);
    background-color: transparent;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--jdgm-text-light);
}

.jdgm-rev__vote-button:hover {
    border-color: var(--jdgm-primary);
    color: var(--jdgm-primary);
}

/* Store Reply */

.jdgm-rev__reply {
    margin-top: 16px;
    padding: 12px;
    background-color: var(--jdgm-bg-light);
    border-left: 3px solid var(--jdgm-primary);
    border-radius: 4px;
}

.jdgm-rev__replier-wrapper {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--jdgm-text);
}

.jdgm-rev__replier {
    color: var(--jdgm-primary);
}

.jdgm-rev__reply-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--jdgm-text);
    margin: 0;
}

.jdgm-rev__reply-content p {
    margin: 0;
}

/* =====================================================
   Load More / Pagination
   ===================================================== */

.jdgm-paginate {
    display: flex;
    justify-content: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--jdgm-border);
}

.jdgm-paginate__load-more {
    width: 100%;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 500;
}

.jdgm-paginate__load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =====================================================
   Responsive Design
   ===================================================== */

@media (max-width: 768px) {
    .jdgm-row-stars {
        flex-direction: column;
        gap: 16px;
    }

    .jdgm-rev-widg__title {
        font-size: 20px;
    }

    .jdgm-rev-widg__summary-stars {
        font-size: 16px;
    }

    .jdgm-rev-widg__summary-average {
        font-size: 16px;
    }

    .jdgm-form-wrapper {
        padding: 16px;
    }

    .jdgm-form__fieldset-actions {
        flex-direction: column-reverse;
    }

    .jdgm-sort-dropdown {
        min-width: 100%;
    }

    .jdgm-gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .jdgm-rev {
        padding: 16px 0;
    }

    .jdgm-row-rating {
        flex-wrap: wrap;
    }

    .jdgm-rev__timestamp {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .jdgm-rev-widg__title {
        font-size: 18px;
    }

    .jdgm-rev-widg__summary-stars {
        font-size: 14px;
    }

    .jdgm-write-rev-link {
        width: 100%;
        text-align: center;
    }

    .jdgm-form__fieldset-actions {
        gap: 8px;
    }

    .jdgm-btn {
        flex: 1;
        padding: 10px 16px;
    }

    .jdgm-gallery {
        grid-template-columns: repeat(3, 1fr);
    }

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

/* =====================================================
   Animation & Transitions
   ===================================================== */

.jdgm-form-wrapper {
    animation: slideDown 0.3s ease-out;
}

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

/* Loading state */

.jdgm-paginate__load-more.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* =====================================================
   Utility Classes
   ===================================================== */

.jdgm-inline-label {
    display: inline;
}

.jdgm-countdown {
    font-size: 12px;
    color: var(--jdgm-text-light);
    margin-left: 8px;
}