/**
 * EpdProductDesigner Admin Styles
 *
 * @package EpdProductDesigner
 * @license GPL-2.0-or-later
 */

/* Status badges in submission list */
.epdesigner-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.epdesigner-status-pending {
    color: #996800;
    background: #fcf0c3;
}

.epdesigner-status-processing {
    color: #0073aa;
    background: #e5f5fa;
}

.epdesigner-status-completed {
    color: #008a20;
    background: #d4edda;
}

.epdesigner-status-archived {
    color: #666;
    background: #eee;
}

/* Submission details table */
.epdesigner-submission-details th {
    width: 150px;
    padding: 15px 10px;
    vertical-align: top;
}

.epdesigner-submission-details td {
    padding: 15px 10px;
}

.epdesigner-submission-details img {
    max-width: 300px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}



/* =============================================================================
   Product Meta Box Styles
   ============================================================================= */

/* Collapsible sections */
.epdesigner-meta-section {
    margin-bottom: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.epdesigner-meta-section h4 {
    margin: 0;
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-bottom: 1px solid #ddd;
    border-radius: 4px 4px 0 0;
}

.epdesigner-meta-section h4:hover {
    background: #f6f7f7;
}

.epdesigner-meta-section h4:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: -2px;
}

.epdesigner-meta-section h4 .dashicons {
    color: #666;
    transition: transform 0.2s;
}

.epdesigner-meta-section.collapsed h4 {
    border-bottom: none;
    border-radius: 4px;
}

.epdesigner-meta-section.collapsed h4 .dashicons {
    transform: rotate(-90deg);
}

.epdesigner-meta-section .epdesigner-section-content {
    padding: 15px;
}

.epdesigner-meta-section.collapsed .epdesigner-section-content {
    display: none;
}

/* Editable Areas - Tabbed Interface */
.epdesigner-area-tabs {
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
}

.epdesigner-area-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    background: #f0f0f1;
    border-bottom: 1px solid #ccc;
    padding: 0;
    align-items: stretch;
}

.epdesigner-area-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-right: 1px solid #ccc;
    cursor: pointer;
    font-size: 13px;
    color: #50575e;
    transition: background 0.15s, color 0.15s;
    position: relative;
    margin-bottom: -1px;
}

.epdesigner-area-tab:hover {
    background: #e0e0e0;
}

.epdesigner-area-tab.active {
    background: #fff;
    color: #1d2327;
    font-weight: 600;
    border-bottom: 1px solid #fff;
}

.epdesigner-area-tab:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: -2px;
}

.epdesigner-area-tab-label {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.epdesigner-area-tab-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    color: #767676;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.epdesigner-area-tab-remove:hover {
    background: #d63638;
    color: #fff;
}

.epdesigner-area-tab-remove:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.epdesigner-area-tab-add {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    padding: 10px 0;
    background: transparent;
    border: none;
    border-right: none;
    cursor: pointer;
    font-size: 20px;
    font-weight: 300;
    color: #2271b1;
    transition: background 0.15s, color 0.15s;
}

.epdesigner-area-tab-add:hover {
    background: #2271b1;
    color: #fff;
}

.epdesigner-area-tab-add:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.epdesigner-area-panels {
    padding: 15px;
}

.epdesigner-area-panel {
    display: none;
}

.epdesigner-area-panel.active {
    display: block;
}

.epdesigner-area-panel .epdesigner-area-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 15px;
}

.epdesigner-area-panel .epdesigner-area-fields .epdesigner-field-full {
    grid-column: span 1;
}

.epdesigner-area-panel label {
    display: block;
    font-size: 11px;
    margin-bottom: 2px;
    font-weight: 600;
}

.epdesigner-area-panel input[type="text"],
.epdesigner-area-panel select {
    width: 100%;
}

.epdesigner-area-panel input[type="number"] {
    width: 60px;
}

/* Empty state */
.epdesigner-area-empty {
    text-align: center;
    padding: 30px 20px;
}

.epdesigner-area-empty p {
    margin: 0 0 15px 0;
    color: #666;
}

/* Slider field styling */
.epdesigner-slider-field {
    margin-top: 0;
}

.epdesigner-slider-field label {
    color: #666;
    font-weight: normal;
    font-size: 11px;
}

.epdesigner-slider-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.epdesigner-slider-row input[type="range"] {
    flex: 1;
    min-width: 60px;
    cursor: pointer;
}

.epdesigner-slider-row input[type="number"] {
    width: 55px;
    flex: 0 0 auto;
    padding: 3px 5px;
}

/* SVG upload field styling */
.epdesigner-svg-upload-field {
    grid-column: span 2;
}

.epdesigner-svg-upload-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.epdesigner-svg-upload-row input[type="text"].epdesigner-svg-url {
    flex: 1;
    min-width: 150px;
    background: #f9f9f9;
}

.epdesigner-svg-upload-row .button {
    flex-shrink: 0;
}

.epdesigner-svg-upload-field .description {
    margin-top: 5px;
    font-size: 11px;
    color: #666;
}

.epdesigner-svg-status {
    margin-top: 5px;
    padding: 6px 10px;
    border-radius: 3px;
    font-size: 12px;
    display: none;
}

.epdesigner-svg-status.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.epdesigner-svg-status.warning {
    display: block;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.epdesigner-svg-status.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.epdesigner-svg-help {
    margin-top: 8px;
}

.epdesigner-svg-help summary {
    cursor: pointer;
    color: #0073aa;
    font-size: 12px;
}

.epdesigner-svg-help summary:hover {
    text-decoration: underline;
}

.epdesigner-svg-help-content {
    margin-top: 8px;
    padding: 10px;
    background: #f0f6fc;
    border: 1px solid #c5d9ed;
    border-radius: 3px;
    font-size: 12px;
}

.epdesigner-svg-help-content ul {
    margin: 5px 0 10px 20px;
    padding: 0;
}

.epdesigner-svg-help-content li {
    margin-bottom: 3px;
}

.epdesigner-svg-help-content p {
    margin: 8px 0;
}

.epdesigner-svg-help-content em {
    color: #666;
}

/* Responsive editable area grid */
@media (min-width: 1600px) {
    .epdesigner-area-panel .epdesigner-area-fields {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1599px) and (min-width: 1200px) {
    .epdesigner-area-panel .epdesigner-area-fields {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1199px) and (min-width: 1100px) {
    .epdesigner-area-panel .epdesigner-area-fields {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1099px) and (min-width: 782px) {
    .epdesigner-area-panel .epdesigner-area-fields {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 781px) {
    .epdesigner-area-panel .epdesigner-area-fields {
        grid-template-columns: 1fr;
    }
}

.epdesigner-preview-canvas {
    border: 2px solid #0073aa;
    border-radius: 4px;
    max-width: 100%;
    background: #fff;
    display: block;
}

.epdesigner-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.epdesigner-color-row input[type="color"] {
    cursor: pointer;
    border: 1px solid #ccc;
}

.epdesigner-color-hex {
    font-family: monospace;
    color: #666;
    font-size: 12px;
    min-width: 70px;
}

/* Visual Editor - Compact Header Bar */
.epdesigner-visual-editor {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    margin-bottom: 15px;
    overflow: hidden;
}

.epdesigner-image-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f6f7f7;
    border-bottom: 1px solid #ddd;
    flex-wrap: wrap;
}

.epdesigner-image-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.epdesigner-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.epdesigner-image-thumb .dashicons {
    font-size: 20px;
    color: #767676;
}

.epdesigner-image-info {
    flex: 1 1 auto;
    min-width: 150px;
}

.epdesigner-image-name {
    font-weight: 600;
    color: #1d2327;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.epdesigner-image-name.no-image {
    color: #666;
    font-weight: normal;
    font-style: italic;
}

.epdesigner-image-dimensions {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.epdesigner-image-dimensions .dimensions-text {
    font-family: monospace;
}

.epdesigner-image-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.epdesigner-dimensions-toggle {
    color: #2271b1;
    text-decoration: none;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.epdesigner-dimensions-toggle:hover {
    color: #135e96;
}

.epdesigner-dimensions-toggle .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    transition: transform 0.2s;
}

.epdesigner-dimensions-toggle.open .dashicons {
    transform: rotate(180deg);
}

.epdesigner-dimensions-panel {
    display: none;
    padding: 12px 16px;
    background: #fafafa;
    border-bottom: 1px solid #ddd;
}

.epdesigner-dimensions-panel.open {
    display: block;
}

.epdesigner-dimensions-panel .dimension-inputs {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.epdesigner-dimensions-panel .dimension-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 12px;
}

.epdesigner-dimensions-panel .dimension-field input {
    width: 90px;
}

.epdesigner-preview-area {
    padding: 16px;
}

/* Preview header with toggle */
.epdesigner-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.epdesigner-preview-header h5 {
    margin: 0;
    font-size: 13px;
    color: #1d2327;
}

.epdesigner-preview-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #f0f0f1;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #2c3338;
    transition: all 0.2s;
}

.epdesigner-preview-toggle:hover {
    background: #e0e0e0;
    border-color: #8c8f94;
}

.epdesigner-preview-toggle.active {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.epdesigner-preview-toggle .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 16px;
}

/* Scrollable container for 1:1 mode */
.epdesigner-preview-scroll {
    max-height: 600px;
    overflow: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
}

.epdesigner-preview-scroll.original-size {
    padding: 10px;
}

.epdesigner-preview-scroll:not(.original-size) {
    border: none;
    background: transparent;
    overflow: visible;
    max-height: none;
}

/* Canvas sizing info */
.epdesigner-preview-info {
    font-size: 11px;
    color: #666;
    margin-top: 6px;
    font-style: italic;
}



/* Badge styles */
.epdesigner-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Settings page tabs */
.epdesigner-settings-tabs {
    margin-bottom: 0;
}

.epdesigner-settings-panel {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-top: none;
    padding: 0 12px;
}

/* Help tip tooltips */
.epdesigner-help-tip {
    display: inline-block;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-left: 4px;
    cursor: help;
    color: #767676;
    position: relative;
    border: 1.5px solid #767676;
    border-radius: 50%;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    font-style: normal;
    line-height: 15px;
    box-sizing: border-box;
}

.epdesigner-help-tip::before {
    content: "?";
}

.epdesigner-help-tip::after {
    content: attr(data-tip);
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    font-size: 12px;
    font-weight: normal;
    line-height: 1.4;
    padding: 6px 10px;
    border-radius: 4px;
    white-space: normal;
    width: 220px;
    margin-bottom: 6px;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.epdesigner-help-tip:hover::after,
.epdesigner-help-tip.active::after {
    display: block;
}

.epdesigner-help-tip:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* ==========================================================================
   Image Library Grid (Product Editor)
   ========================================================================== */

.epdesigner-library-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.epdesigner-library-thumb {
    position: relative;
    width: 80px;
    height: 80px;
    border: 2px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
}

.epdesigner-library-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.epdesigner-library-thumb:hover {
    border-color: #0073aa;
}

.epdesigner-library-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 18px;
    text-align: center;
    padding: 0;
    display: none;
}

.epdesigner-library-thumb:hover .epdesigner-library-remove {
    display: block;
}

.epdesigner-library-remove:hover {
    background: #a00;
}

/* Premium field indicator (stripped by Freemius in free build) */

