/**
 * Pro Media Manager - Admin Styles
 *
 * @package PackshotPhotoAI
 */

:root {
    /* WordPress Admin Colors - Light Mode */
    --packshotphoto-primary: #2271b1;
    --packshotphoto-primary-hover: #135e96;
    --packshotphoto-accent: #d63638;
    --packshotphoto-success: #00a32a;
    --packshotphoto-error: #d63638;
    --packshotphoto-warning: #dba617;
    --packshotphoto-border: #c3c4c7;
    --packshotphoto-bg: #f0f0f1;
    --packshotphoto-card-bg: #ffffff;
    --packshotphoto-text: #3c434a;
    --packshotphoto-text-muted: #646970;
    --packshotphoto-radius: 6px;
    --packshotphoto-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Fix for standard WP notices and other plugins inside PMM pages */
.packshotphoto-settings-page .notice, 
.packshotphoto-settings-page .updated, 
.packshotphoto-settings-page .error {
    color: var(--packshotphoto-text) !important;
    background: var(--packshotphoto-card-bg) !important;
    border-left: 4px solid var(--packshotphoto-primary) !important;
}


/* ===== PAGE TITLE & CREDITS BADGE ===== */
.packshotphoto-page-title {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px !important;
}

.packshotphoto-credits-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--packshotphoto-radius);
    font-size: 12px;
    font-weight: 500;
    cursor: default;
    margin-left: 10px;
    vertical-align: middle;
    background: var(--packshotphoto-card-bg);
    border: 1px solid var(--packshotphoto-border);
    color: var(--packshotphoto-text);
}

.packshotphoto-credits-badge .packshotphoto-icon-coin {
    font-size: 14px;
}

.packshotphoto-credits-badge .packshotphoto-balance-count {
    font-size: 14px;
    font-weight: 600;
}

.packshotphoto-credits-badge .packshotphoto-balance-label {
    font-size: 11px;
    color: var(--packshotphoto-text-muted);
}

/* Badge States */
.packshotphoto-badge-success { background: #e6f4ea; border: 1px solid #ceead6; color: #137333; }
.packshotphoto-badge-warning { background: #fef7e0; border: 1px solid #feefc3; color: #b06000; }
.packshotphoto-badge-danger  { background: #fce8e6; border: 1px solid #fad2cf; color: #c5221f; }

/* Animation for low credits */
.packshotphoto-badge-danger {
    animation: packshotphoto-pulse-red 2s infinite;
}

@keyframes packshotphoto-pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(214, 54, 56, 0.3); }
    70% { box-shadow: 0 0 0 8px rgba(214, 54, 56, 0); }
    100% { box-shadow: 0 0 0 0 rgba(214, 54, 56, 0); }
}

/* ===== MEDIA LIBRARY COLUMNS ===== */

/* Prevent squishing columns when other active plugins add extra columns */
.upload-php #posts-filter {
    overflow-x: auto !important;
    max-width: 100% !important;
    padding-bottom: 15px;
}

.wp-list-table.media {
    min-width: 1200px;
    table-layout: auto !important;
}

.wp-list-table.media td,
.wp-list-table.media th {
    vertical-align: top !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
}

.wp-list-table.media td.cb {
    padding-top: 15px !important;
}


/* Column widths */
.wp-list-table.media .column-title {
    width: 18%;
    min-width: 150px;
}

.wp-list-table.media .column-packshotphoto_alt,
.wp-list-table.media .column-packshotphoto_caption,
.wp-list-table.media .column-packshotphoto_desc {
    width: 12%;
    min-width: 100px;
}

.wp-list-table.media .column-packshotphoto_actions {
    width: 50px;
    text-align: center;
}

.wp-list-table.media .column-packshotphoto_slug {
    width: 10%;
    min-width: 80px;
}

.wp-list-table.media .column-packshotphoto_tools {
    width: 90px;
    text-align: center;
    white-space: nowrap;
}

/* Editable cell wrapper */
.packshotphoto-cell-wrapper {
    position: relative;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.packshotphoto-cell-wrapper:focus-within {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.packshotphoto-cell-wrapper:hover {
    border-color: #8c8f94;
}

.packshotphoto-editable {
    width: 100%;
    height: 38px;
    min-height: 38px;
    max-height: 38px;
    padding: 8px;
    border: none;
    background: transparent;
    font-size: 12px;
    line-height: 1.4;
    resize: none;
    box-shadow: none !important;
    outline: none !important;
    color: #2c3338 !important;
    overflow-y: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: transparent !important;
    -webkit-text-fill-color: #2c3338 !important;
    box-sizing: border-box;
}

.packshotphoto-editable:focus {
    border: none;
    box-shadow: none;
    outline: none;
    color: #2c3338 !important;
}

.packshotphoto-editable::placeholder {
    color: #646970;
    font-style: italic;
    -webkit-text-fill-color: #646970 !important;
}

.packshotphoto-cell-wrapper:focus-within .packshotphoto-editable {
    height: 110px;
    min-height: 110px;
    max-height: 160px;
    resize: vertical;
    overflow-y: auto;
}

/* Save indicator */
.packshotphoto-save-indicator {
    position: absolute;
    bottom: 2px;
    right: 6px;
    font-size: 10px;
    color: #2271b1;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.packshotphoto-cell-wrapper.packshotphoto-saving .packshotphoto-save-indicator {
    opacity: 1;
}

.packshotphoto-cell-wrapper.packshotphoto-saved .packshotphoto-save-indicator {
    color: #00a32a;
}

.packshotphoto-cell-wrapper.packshotphoto-error .packshotphoto-save-indicator {
    color: #d63638;
}

/* Skeleton Loader */
.packshotphoto-skeleton {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        var(--packshotphoto-bg) 25%, 
        var(--packshotphoto-border) 50%, 
        var(--packshotphoto-bg) 75%
    );
    background-size: 200% 100%;
    animation: packshotphoto-shimmer 1.5s infinite;
    z-index: 5;
    pointer-events: none;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.packshotphoto-saving .packshotphoto-skeleton,
.packshotphoto-loading .packshotphoto-skeleton {
    opacity: 0.7;
}

@keyframes packshotphoto-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes packshotphoto-flash-anim {
    0% { background-color: #d6f5d6; }
    100% { background-color: transparent; }
}

/* ===== AI BUTTON ===== */

.packshotphoto-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.packshotphoto-ai-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 10px !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    background: #2271b1 !important;
    color: #fff !important;
    border: 1px solid #2271b1 !important;
    border-radius: 4px !important;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

.packshotphoto-ai-btn:hover {
    background: #135e96 !important;
    border-color: #135e96 !important;
    color: #fff !important;
    transform: none;
    box-shadow: none;
}

.packshotphoto-ai-btn:active {
    background: #0e4f7e !important;
}

.packshotphoto-ai-btn.packshotphoto-loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

#packshotphoto_site_context.packshotphoto-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

#packshotphoto_site_context.packshotphoto-flash {
    background-color: #d6f5d6 !important;
    transition: background-color 0.3s;
}

.packshotphoto-ai-btn.packshotphoto-loading::after {
    content: '';
    display: none;
}

/* Badges */
.packshotphoto-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 10px;
    border-radius: 4px;
    font-weight: 600;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: 1px solid transparent;
}

.packshotphoto-badge-success {
    background: #e6f4ea;
    border-color: #ceead6;
    color: #137333;
}

.packshotphoto-badge-info {
    background: #e8f0fe;
    border-color: #d2e3fc;
    color: #1a73e8;
}

/* WebP Button */
.packshotphoto-webp-actions {
    display: flex;
    justify-content: center;
}

.packshotphoto-webp-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px !important;
    padding: 2px 8px !important;
    background: #f0f0f1 !important;
    color: #2c3338 !important;
    border: 1px solid #dcdcde !important;
    border-radius: 4px !important;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

.packshotphoto-resize-btn,
.packshotphoto-manual-resize-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px !important;
    padding: 2px 6px !important;
    background: #f0f0f1 !important;
    color: #2c3338 !important;
    border: 1px solid #dcdcde !important;
    border-radius: 4px !important;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.packshotphoto-webp-btn:hover,
.packshotphoto-resize-btn:hover,
.packshotphoto-manual-resize-trigger:hover {
    background: #e0e0e2 !important;
    border-color: #8c8f94 !important;
    transform: none;
    box-shadow: none;
}

.packshotphoto-restore-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px !important;
    padding: 2px 6px !important;
    background: #f0f0f1 !important;
    color: #2c3338 !important;
    border: 1px solid #dcdcde !important;
    border-radius: 4px !important;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.packshotphoto-restore-btn:hover {
    background: #e0e0e2 !important;
    border-color: #8c8f94 !important;
}

.packshotphoto-restore-btn.packshotphoto-loading {
    opacity: 0.7;
    pointer-events: none;
}

.packshotphoto-resize-btn[style*="color: #d63638"],
.packshotphoto-resize-btn[style*="color:#d63638"] {
    color: #d63638 !important;
}

.packshotphoto-btn-text {
    font-size: 10px;
}

/* AI Button queued state */
.packshotphoto-ai-btn.packshotphoto-queued {
    opacity: 0.7;
    background: #dba617 !important;
    border-color: #dba617 !important;
    color: #fff !important;
    pointer-events: none;
}

/* Filename & Revert Styling */
.packshotphoto-filename-wrapper {
    padding: 0;
    border: none !important;
    background: transparent !important;
}

.packshotphoto-filename-edit-group {
    display: flex;
    align-items: center;
    gap: 0;
    width: 100%;
}

.packshotphoto-filename-input {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 6px 8px !important;
    background: #fff !important;
    border: 1px solid #dcdcde !important;
    border-radius: 4px;
    color: #2c3338 !important;
    -webkit-text-fill-color: #2c3338 !important;
    box-sizing: border-box;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.packshotphoto-filename-input:focus {
    border-color: #2271b1 !important;
    box-shadow: 0 0 0 1px #2271b1 !important;
}

/* Slug Input */
.packshotphoto-slug-wrapper {
    padding: 2px;
}

.packshotphoto-slug-input {
    width: 100%;
    padding: 6px 8px;
    border: none;
    background: transparent;
    font-size: 11px;
    font-family: monospace;
    box-shadow: none !important;
    outline: none !important;
    color: #2c3338 !important;
}

.packshotphoto-slug-input:focus {
    border: none;
    box-shadow: none;
    outline: none;
}

/* Comparison Slider */
.packshotphoto-comparison-slider {
    position: relative;
    width: 100%;
    height: 350px;
    background-color: #f0f0f1;
    overflow: hidden;
    user-select: none;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid var(--packshotphoto-border);
}

.packshotphoto-img-before,
.packshotphoto-img-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.packshotphoto-img-after {
    z-index: 2;
    clip-path: inset(0 0 0 50%);
}

.packshotphoto-slider-handle {
    position: absolute;
    top: 0;
    left: 50%;
    height: 100%;
    width: 4px;
    background: var(--packshotphoto-primary);
    cursor: ew-resize;
    z-index: 10;
    transform: translateX(-50%);
}

.packshotphoto-handle-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    color: var(--packshotphoto-primary);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    border: 2px solid var(--packshotphoto-primary);
}

.packshotphoto-label {
    position: absolute;
    top: 10px;
    padding: 3px 8px;
    background: var(--packshotphoto-card-bg);
    color: var(--packshotphoto-text);
    font-size: 11px;
    border-radius: 3px;
    z-index: 5;
}

.packshotphoto-label-before { left: 10px; }
.packshotphoto-label-after { right: 10px; }

.packshotphoto-comparison-stats {
    text-align: center;
    background: var(--packshotphoto-card-bg);
    padding: 12px;
    border-radius: 4px;
    font-size: 13px;
    border: 1px solid var(--packshotphoto-border);
}

.packshotphoto-text-success { color: var(--packshotphoto-success); font-weight: 700; }
.packshotphoto-text-error { color: var(--packshotphoto-error); font-weight: 700; }

/* ===== SETTINGS PAGE (WordPress Native) ===== */

.packshotphoto-settings-page {
    max-width: 1200px;
    margin: 20px auto 40px 0;
    color: var(--packshotphoto-text);
}

.packshotphoto-settings-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 30px;
    align-items: start;
}

.packshotphoto-main-settings {
    min-width: 0;
}

.packshotphoto-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.packshotphoto-settings-page h1 {
    font-size: 23px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Sections */
.packshotphoto-settings-page h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--packshotphoto-text);
    margin: 30px 0 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--packshotphoto-border);
}

/* Table layout - native WordPress */
.packshotphoto-settings-page .form-table {
    margin-top: 0;
}

.packshotphoto-settings-page .form-table th {
    padding: 15px 10px 15px 0;
    color: var(--packshotphoto-text);
    font-weight: 500;
}

.packshotphoto-settings-page .form-table td {
    padding: 10px;
}

/* Input Styles - WordPress native */
.packshotphoto-settings-page input[type="text"],
.packshotphoto-settings-page input[type="password"],
.packshotphoto-settings-page input[type="number"],
.packshotphoto-settings-page textarea,
.packshotphoto-settings-page select {
    width: 100% !important;
    max-width: 100% !important;
}

/* Buttons - WordPress native */
.packshotphoto-settings-page .button-secondary {
    border: 1px solid var(--packshotphoto-border) !important;
}

/* Pro Billing Section - WordPress Native Cards */
.packshotphoto-pro-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.packshotphoto-pro-card {
    background: var(--packshotphoto-card-bg);
    border: 1px solid var(--packshotphoto-border);
    border-radius: var(--packshotphoto-radius);
    padding: 20px;
    text-align: center;
}

.packshotphoto-pro-card.featured {
    border-color: var(--packshotphoto-primary);
    border-width: 2px;
}

.packshotphoto-pro-card h3 {
    font-size: 16px;
    margin: 0 0 10px;
    color: var(--packshotphoto-text);
}

.packshotphoto-pro-price {
    font-size: 32px;
    font-weight: 600;
    margin: 15px 0;
    color: var(--packshotphoto-text);
}

.packshotphoto-pro-price span {
    font-size: 14px;
    color: var(--packshotphoto-text-muted);
}

.packshotphoto-pro-features {
    list-style: disc;
    padding-left: 20px;
    margin: 20px 0;
    text-align: left;
}

.packshotphoto-pro-features li {
    margin-bottom: 8px;
    font-size: 13px;
}

.packshotphoto-pro-btn {
    display: block;
    width: 100%;
    background: var(--packshotphoto-primary);
    color: #fff;
    text-decoration: none;
    padding: 12px;
    border-radius: var(--packshotphoto-radius);
    font-weight: 500;
    margin-top: 15px;
}

.packshotphoto-pro-btn:hover {
    background: var(--packshotphoto-primary-hover);
    color: #fff;
}

/* API Key wrapper */
.packshotphoto-api-key-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.packshotphoto-api-key-wrapper input[type="password"] {
    flex: 1;
    max-width: 400px;
}

.packshotphoto-test-result {
    font-size: 13px;
    padding: 4px 8px;
    border-radius: var(--packshotphoto-radius);
}

.packshotphoto-test-result.packshotphoto-success {
    background: #d6f5d6;
    color: #0a5c0a;
}

.packshotphoto-test-result.packshotphoto-error {
    background: #fce4e4;
    color: #8b0000;
}

/* Info box - WordPress Native */
.packshotphoto-info-box {
    padding: 15px 20px;
    background: #f6f7f7;
    border-left: 4px solid var(--packshotphoto-primary);
    margin: 15px 0;
}

.packshotphoto-info-box-sidebar {
    margin-top: 0;
    background: #f6f7f7;
    border-left: 4px solid var(--packshotphoto-accent);
}

.packshotphoto-info-box h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.packshotphoto-info-box ol, .packshotphoto-info-box ul {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    line-height: 1.6;
}

.packshotphoto-info-box li {
    margin-bottom: 8px;
}

/* Tooltips - WordPress Native */
.packshotphoto-help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--packshotphoto-border);
    color: var(--packshotphoto-text-muted);
    border-radius: 50%;
    font-size: 10px;
    cursor: help;
    margin-left: 6px;
    vertical-align: middle;
}

.packshotphoto-help-icon:hover {
    background: var(--packshotphoto-primary);
    color: #fff;
}

.packshotphoto-tooltip-container {
    position: relative;
    display: inline-block;
}

.packshotphoto-tooltip-text {
    visibility: hidden;
    width: 240px;
    background-color: var(--packshotphoto-card-bg);
    color: var(--packshotphoto-text);
    text-align: left;
    border: 1px solid var(--packshotphoto-border);
    border-radius: 4px;
    padding: 10px;
    position: absolute;
    z-index: 100;
    bottom: 140%;
    left: 50%;
    margin-left: -120px;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 12px;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    white-space: normal;
}

.packshotphoto-tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--packshotphoto-border) transparent transparent transparent;
}

.packshotphoto-tooltip-container:hover .packshotphoto-tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ===== TOAST NOTIFICATIONS ===== */

.packshotphoto-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.packshotphoto-toast {
    padding: 12px 20px;
    background: #fff;
    color: #2c3338;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: packshotphoto-slide-in 0.3s ease;
    max-width: 350px;
}

.packshotphoto-toast.packshotphoto-toast-success {
    background: #00a32a;
    color: #fff;
    border-color: #00a32a;
}

.packshotphoto-toast.packshotphoto-toast-error {
    background: #d63638;
    color: #fff;
    border-color: #d63638;
}

@keyframes packshotphoto-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== BULK PROGRESS BAR ===== */
.packshotphoto-bulk-progress-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999999;
    display: flex;
    align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: all 0.2s ease;
}

.packshotphoto-bulk-progress-overlay.active {
    opacity: 1; visibility: visible;
}

.packshotphoto-bulk-progress-card {
    background: var(--packshotphoto-card-bg);
    border: 1px solid var(--packshotphoto-border);
    border-radius: var(--packshotphoto-radius);
    padding: 30px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.packshotphoto-bulk-progress-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--packshotphoto-text);
}

.packshotphoto-bulk-progress-subtitle {
    font-size: 13px;
    color: var(--packshotphoto-text-muted);
    margin-bottom: 20px;
}

.packshotphoto-progress-track {
    height: 8px;
    background: var(--packshotphoto-border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
}

.packshotphoto-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--packshotphoto-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.packshotphoto-bulk-stats {
    display: flex;
    justify-content: space-around;
    padding: 12px;
    background: var(--packshotphoto-bg);
    border-radius: var(--packshotphoto-radius);
    font-size: 12px;
    color: var(--packshotphoto-text-muted);
}

.packshotphoto-bulk-stats span strong {
    font-size: 14px;
    display: block;
    margin-bottom: 2px;
    color: var(--packshotphoto-text);
}

.packshotphoto-stat-success strong { color: var(--packshotphoto-success); }
.packshotphoto-stat-error strong { color: var(--packshotphoto-error); }
.packshotphoto-stat-remaining strong { color: var(--packshotphoto-text-muted); }

/* ===== RESPONSIVE ===== */

@media screen and (max-width: 1200px) {

    .wp-list-table.media .column-packshotphoto_alt,
    .wp-list-table.media .column-packshotphoto_caption,
    .wp-list-table.media .column-packshotphoto_desc {
        width: 15% !important;
        min-width: 120px;
    }

    .packshotphoto-settings-grid {
        grid-template-columns: 1fr;
    }
    
    .packshotphoto-sidebar {
        order: 2;
    }
}

@media screen and (max-width: 782px) {
    /* Hide less essential columns on mobile WP list */
    .wp-list-table.media .column-packshotphoto_slug,
    .wp-list-table.media .column-packshotphoto_tools {
        display: none !important;
    }
    
    .packshotphoto-page-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .packshotphoto-credits-badge {
        margin-left: 0;
    }
    
    .packshotphoto-tabs.nav-tab-wrapper {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        gap: 10px;
    }
    
    .packshotphoto-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .packshotphoto-pro-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Better table row styling for mobile */
    .wp-list-table.media tr:not(.inline-edit-row) td {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
        padding-left: 10px !important;
    }
    
    .wp-list-table.media tr:not(.inline-edit-row) td::before {
        display: none !important;
    }
}

/* ===== MICRO-INTERACTIONS & POLISH ===== */

.packshotphoto-editable, .packshotphoto-filename-input {
    transition: border-color 0.2s, box-shadow 0.2s;
}

.packshotphoto-tools-actions .button.button-small {
    padding: 2px 8px !important;
    font-size: 11px !important;
    line-height: 1.3 !important;
    min-height: 24px !important;
}

.packshotphoto-ai-btn:active, .packshotphoto-webp-btn:active, .packshotphoto-pro-btn:active {
    transform: scale(0.98);
}

.packshotphoto-cell-wrapper:hover {
    border-color: var(--packshotphoto-primary);
}

.packshotphoto-flash {
    animation: packshotphoto-flash-anim 0.8s ease-out;
}

.packshotphoto-editable.packshotphoto-flash,
.packshotphoto-filename-input.packshotphoto-flash,
#packshotphoto_site_context.packshotphoto-flash {
    background-color: #d6f5d6 !important;
}

/* ===== MODAL - WordPress Native ===== */

.packshotphoto-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

.packshotphoto-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.packshotphoto-modal {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
    border-radius: 12px !important;
    padding: 24px !important;
    width: 460px !important;
    max-width: 90vw !important;
    transform: scale(0.98) !important;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    color: #1e293b !important;
    box-sizing: border-box !important;
}

.packshotphoto-modal-overlay.active .packshotphoto-modal {
    transform: scale(1) !important;
}

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

.packshotphoto-modal-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.packshotphoto-modal-body {
    font-size: 13px !important;
    color: #475569 !important;
    margin-bottom: 20px !important;
    line-height: 1.6 !important;
}

.packshotphoto-modal-checkbox-wrapper {
    margin-top: 16px !important;
    padding-top: 12px !important;
    border-top: 1px solid #cbd5e1 !important;
    font-size: 12px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.packshotphoto-modal-checkbox-label {
    color: #334155 !important;
    font-weight: 500 !important;
    cursor: pointer !important;
}


.packshotphoto-field-checkboxes {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.packshotphoto-field-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    color: #334155;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}

.packshotphoto-field-check:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.packshotphoto-field-check input[type="checkbox"] {
    margin-top: 2px;
    accent-color: var(--packshotphoto-primary);
}

.packshotphoto-field-check small {
    display: block;
    margin-top: 2px;
    color: #64748b;
}

.packshotphoto-field-check-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-size: 12px;
}

.packshotphoto-field-check-info strong {
    font-weight: 600;
}

.packshotphoto-field-check-compact {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 12px;
}

.packshotphoto-field-check-compact input[type="checkbox"] {
    margin-top: 0;
    flex-shrink: 0;
}

.packshotphoto-field-label {
    font-weight: 600;
    font-size: 12px;
    min-width: 60px;
    flex-shrink: 0;
    color: #0f172a;
}

.packshotphoto-field-diff {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    overflow: hidden;
    min-width: 0;
}

.packshotphoto-diff-old {
    color: var(--packshotphoto-text-muted);
    text-decoration: line-through;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100px;
}

.packshotphoto-diff-arrow {
    color: var(--packshotphoto-text-muted);
    flex-shrink: 0;
}

.packshotphoto-diff-new {
    color: var(--packshotphoto-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100px;
}

.packshotphoto-restore-comparison {
    margin-top: 8px;
}

/* Modal Prompt & Previews */
.packshotphoto-modal-prompt {
    margin-bottom: 15px;
    font-size: 13px;
    color: #334155;
    font-weight: 500;
    line-height: 1.5;
}

.packshotphoto-field-preview {
    color: #64748b;
    margin-left: 4px;
    font-weight: normal;
}

/* Modal Warning Box */
.packshotphoto-warning-box {
    margin-left: 24px;
    margin-top: 6px;
    padding: 12px;
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    font-size: 13px;
    color: #78350f;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.packshotphoto-warning-box-title {
    color: #b45309;
    display: block;
    margin-bottom: 4px;
    font-weight: 700;
}

.packshotphoto-warning-box-text {
    line-height: 1.5;
    color: #78350f;
}

.packshotphoto-warning-box-card {
    margin-top: 10px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #ffffff !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    border: 1px solid #fde8c3 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

.packshotphoto-warning-box-card-title {
    font-weight: 700;
    display: block;
    color: #1e293b;
}

.packshotphoto-warning-box-card-desc {
    display: block;
    color: #64748b;
    line-height: 1.4;
    margin-top: 2px;
    font-size: 11px;
}

.packshotphoto-warning-box-footer {
    margin-top: 8px;
    font-size: 11px;
    font-style: italic;
    color: #92400e;
    margin-bottom: 0;
}

.packshotphoto-modal-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.packshotphoto-btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.packshotphoto-btn-secondary {
    background: var(--packshotphoto-card-bg);
    color: var(--packshotphoto-text);
    border: 1px solid var(--packshotphoto-border);
}

.packshotphoto-btn-secondary:hover {
    background: var(--packshotphoto-bg);
}

.packshotphoto-btn-primary {
    background: var(--packshotphoto-primary);
    color: #fff;
    border: 1px solid var(--packshotphoto-primary-hover);
}

.packshotphoto-btn-primary:hover {
    background: var(--packshotphoto-primary-hover);
}

.packshotphoto-btn-danger:hover {
    background: #c42b2b;
}

/* Unified Convert Modal Styling */
.packshotphoto-convert-modal-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 15px;
    margin-bottom: 5px;
}

.packshotphoto-convert-card {
    display: flex;
    flex-direction: column;
    padding: 16px;
    border-radius: 12px;
    border: 2px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    text-align: left;
    position: relative;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.packshotphoto-convert-card:hover {
    border-color: rgba(34, 113, 177, 0.3);
    background: rgba(34, 113, 177, 0.02);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.packshotphoto-convert-card.active {
    border-color: #2271b1;
    background: rgba(34, 113, 177, 0.05);
    box-shadow: 0 4px 16px rgba(34, 113, 177, 0.12);
}

.packshotphoto-convert-card .packshotphoto-card-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.packshotphoto-convert-card .packshotphoto-option-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.packshotphoto-convert-card .packshotphoto-option-desc {
    font-size: 12px;
    color: #334155;
    line-height: 1.5;
    margin-bottom: 16px;
    flex-grow: 1;
}

.packshotphoto-convert-card .packshotphoto-option-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #0f172a;
    background: rgba(0, 0, 0, 0.04);
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.packshotphoto-convert-card .packshotphoto-option-sim-size {
    font-weight: 600;
}

.packshotphoto-convert-card .packshotphoto-savings-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    background: #ecfdf5;
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.1);
}


.packshotphoto-input-field {
    width: 100% !important;
    padding: 8px 12px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
}

.packshotphoto-input-field:focus {
    outline: none !important;
    border-color: #2271b1 !important;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2) !important;
}

@media (prefers-color-scheme: dark) {
    .packshotphoto-modal-overlay {
        background: rgba(15, 23, 42, 0.75);
        backdrop-filter: blur(8px);
    }
}

/* Pulsing orange processing badge in columns */
.packshotphoto-processing-badge {
    background: #fff8e1 !important;
    border: 1px solid #ffe082 !important;
    color: #b78103 !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    padding: 6px 8px !important;
    border-radius: 4px !important;
    text-align: center !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    animation: packshotphoto-pulse-orange 2s infinite ease-in-out !important;
    display: inline-block !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

@keyframes packshotphoto-pulse-orange {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ===== EU AI ACT SETTINGS & WATERMARKING ===== */
.packshotphoto-preset-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
}

.packshotphoto-preset-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.packshotphoto-preset-card.selected {
    box-shadow: 0 0 0 2px #2271b1, 0 4px 12px rgba(34,113,177,0.15) !important;
}

.packshotphoto-pos-btn:hover {
    border-color: #2271b1 !important;
    background: #f0f7ff !important;
}

.packshotphoto-pos-btn.active {
    background: #2271b1 !important;
    color: #ffffff !important;
    border-color: #2271b1 !important;
    box-shadow: 0 2px 4px rgba(34,113,177,0.25);
}

#packshotphoto-live-preview-box {
    background-size: cover;
    background-position: center;
}



