/* Admin CSS for Zetpy Product Review */

/* Common Styles */
.zetpy-rating-stars .star {
    color: #ffc107;
    font-size: 16px;
}

.zetpy-rating-stars .star.empty {
    color: #ddd;
}

.status-badge {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-pending {
    background: #f56e28;
    color: white;
}

.status-approved {
    background: #46b450;
    color: white;
}

.status-rejected {
    background: #dc3232;
    color: white;
}

/* Reviews List Table */
.row-actions .approve {
    display: inline !important;
    visibility: visible !important;
}

.row-actions .approve a {
    display: inline !important;
    visibility: visible !important;
    color: #0073aa !important;
}

.featured-badge {
    background: #ffc107;
    color: #212529;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    margin-left: 5px;
}

.review-excerpt {
    max-width: 300px;
    margin-bottom: 8px;
}

.helpful-vote-display {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 4px 8px;
    background: #f8f9fa;
    border: 1px solid #999999;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #495057;
    max-width: fit-content;
}

.helpful-vote-display .helpful-icon {
    font-size: 14px;
    line-height: 1;
}

.helpful-vote-display .helpful-count {
    font-weight: 600;
    color: #0073aa;
    font-size: 13px;
}

.helpful-vote-display .helpful-text {
    color: #6c757d;
    font-size: 11px;
    font-weight: 400;
}

.title-count {
    color: #666;
    font-weight: normal;
}

/* Quick Reply Modal */
.quick-reply-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100000;
    display: none;
}

.quick-reply-modal-content {
    position: relative;
    background: white;
    max-width: 600px;
    margin: 50px auto;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.quick-reply-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    background: #f8f9fa;
    border-radius: 4px 4px 0 0;
}

.quick-reply-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.quick-reply-body {
    padding: 20px;
}

.quick-reply-footer {
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    background: #f8f9fa;
    text-align: right;
    border-radius: 0 0 4px 4px;
}

.quick-reply-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    color: transparent;
    font-size: 0 !important;
    overflow: hidden;
    padding: 0;
}

.quick-reply-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

.quick-reply-close::before,
.quick-reply-close::after {
    content: '';
    position: absolute;
    height: 16px;
    width: 2px;
    background-color: #666;
    top: 50%;
    left: 50%;
}

.quick-reply-close:hover::before,
.quick-reply-close:hover::after {
    background-color: #333;
}

.quick-reply-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.quick-reply-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.review-context {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid #0073aa;
}

.review-context h4 {
    margin: 0 0 10px 0;
    color: #0073aa;
}

.review-context .review-rating {
    margin-bottom: 8px;
}

.review-context .review-text {
    color: #555;
    font-style: italic;
}

#quick-reply-textarea {
    width: 100%;
    min-height: 120px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    font-family: inherit;
    resize: vertical;
}

#quick-reply-textarea::placeholder {
    color: #b0b0b0;
    opacity: 1;
}

#quick-reply-textarea:focus::placeholder {
    color: transparent;
    opacity: 0;
}

.quick-reply-message {
    padding: 12px 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}

.quick-reply-message.error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.quick-reply-message.success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

.quick-reply-message.warning {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    color: #d97706;
}

/* Table Columns */
.wp-list-table .column-status {
    width: 100px;
}

.wp-list-table .column-rating {
    width: 110px;
}

/* Review Edit Form */
#display_name,
#rating,
#content,
#status,
#admin_reply,
.review-edit-main input[type="text"],
.review-edit-main textarea,
.review-edit-main select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

.hndle {
    margin-left: 10px;
}

.review-edit-container {
    display: flex;
    gap: 20px;
}

.review-edit-main {
    flex: 2;
}

.review-edit-sidebar {
    flex: 1;
    min-width: 300px;
}

.review-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.media-item {
    text-align: center;
}

.media-preview {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.media-preview:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.media-preview img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.video-preview {
    position: relative;
}

.video-preview video {
    width: 100%;
    height: 120px;
    object-fit: cover;
    position: relative;
    z-index: 2;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1 !important;
    transition: all 0.2s ease;
    color: white !important;
    font-size: 24px;
    cursor: pointer;
    z-index: 5;
    pointer-events: auto;
}

.video-overlay .play-icon {
    color: white !important;
    font-family: Arial, sans-serif !important;
    line-height: 1;
}

.video-preview:hover .video-overlay {
    opacity: 1;
    background: rgba(0, 0, 0, 0.6);
}

.video-duration {
    position: absolute !important;
    bottom: 4px !important;
    right: 4px !important;
    left: auto !important;
    background: rgba(0, 0, 0, 0.8) !important;
    color: white !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    z-index: 10 !important;
    pointer-events: none !important;
    display: block !important;
}

.media-info {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.product-info,
.customer-info {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.product-image,
.customer-avatar {
    flex-shrink: 0;
}

.product-details h4,
.customer-details h4 {
    margin: 0 0 8px 0;
}

.product-details p,
.customer-details p {
    margin: 4px 0;
    font-size: 13px;
}

.product-details .product-id {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    margin-bottom: 4px;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
}

.anonymous-badge {
    background: #f0ad4e;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-actions .button {
    margin: 0;
}

/* Placeholder Styles */
::placeholder {
    color: #b0b0b0;
    opacity: 1;
}

:focus::placeholder {
    color: transparent;
    opacity: 0;
}

/* Media Modal */
.media-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.media-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
}

.media-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10001;
}

.media-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ff4d4d;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1;
    transition: background-color 0.2s ease;
    color: transparent;
    font-size: 0 !important;
    overflow: hidden;
    padding: 0;
}

.media-modal-close:hover {
    background: #ff3333;
}

.media-modal-close::before,
.media-modal-close::after {
    content: '';
    position: absolute;
    height: 20px;
    width: 2px;
    background-color: white;
    top: 50%;
    left: 50%;
}

.media-modal-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.media-modal-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.media-modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
    min-width: 300px;
    min-height: 200px;
    background: transparent;
}

.media-modal-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 900px;
    max-width: 95vw;
    height: 600px;
    max-height: 85vh;
    overflow: hidden;
}

.media-modal-body img,
.media-modal-body video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.media-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 24px;
    user-select: none;
    transition: background 0.2s;
    z-index: 10002;
    border-radius: 4px;
}

.media-modal-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.media-modal-nav.prev {
    left: 10px;
}

.media-modal-nav.next {
    right: 10px;
}

.media-modal-index {
    padding: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.7);
    width: 100%;
    text-align: center;
}

/* Settings Page */
.zetpy-settings-header {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.zetpy-version-info {
    font-size: 14px;
    color: #666;
}

.nav-tab-wrapper {
    margin-bottom: 0;
    border-bottom: 1px solid #ccd0d4;
}

.tab-content {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-top: none;
    padding: 20px;
    border-radius: 0 0 4px 4px;
}

/* Changelog */
.zetpy-changelog {
    max-width: 800px;
}

.changelog-version {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.changelog-version h2 {
    margin-top: 0;
    color: #23282d;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.version-date {
    font-size: 14px;
    color: #666;
    font-weight: normal;
}

.changelog-version h3 {
    color: #0073aa;
    margin-top: 20px;
}

.changelog-version ul {
    margin-left: 20px;
}

.changelog-version li {
    margin-bottom: 5px;
    position: relative;
}

.changelog-version li.added:before {
    content: "✓";
    color: #46b450;
    font-weight: bold;
    margin-right: 8px;
}

.changelog-version li.improved:before {
    content: "↑";
    color: #00a0d2;
    font-weight: bold;
    margin-right: 8px;
}

.changelog-version li.fixed:before {
    content: "✗";
    color: #dc3232;
    font-weight: bold;
    margin-right: 8px;
}

@media (max-width: 1200px) {
    .review-edit-container {
        flex-direction: column;
    }

    .review-edit-sidebar {
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .review-media-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .product-info,
    .customer-info {
        flex-direction: column;
        text-align: center;
    }
}

/* Full-width input */
#email_subject {
    font-size: 14px;
    padding: 6px 12px;
    height: auto;
}

/* Submit Button Area in Review Edit */
.review-edit-container .submit {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    margin: 20px -12px -12px -12px !important;
    padding: 15px 12px !important;
    border-radius: 0 0 4px 4px;
    width: auto !important;
}

/* Generic submit should be reset to standard behavior if not in our container */
.submit {
    margin: 20px 0;
}

#email_subject,
#admin_email_subject {
    font-size: 14px;
    padding: 6px 12px;
    height: auto;
}

.zetpy-settings-header {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.zetpy-version-info {
    font-size: 14px;
    color: #666;
}