/**
 * PNG Border Generator styles.
 *
 * @package Zipper
 */

#tool-png-border-generator {
    --accent: #b86bff;
    --accent-strong: #8b3ce8;
    --accent-light: #f4ecff;
    --accent-mid: #dcc6ff;
    --surface: #ffffff;
    --border: #e8e4dc;
    --text: #1f1b18;
    --muted: #6f6964;
    --mono: 'Courier New', Courier, monospace;
    --shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
    color: var(--text);
}

.pbg-tool-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.pbg-tool-lead {
    margin: 6px 0 0;
    color: #5f5a56;
    font-size: 14px;
    line-height: 1.65;
}

.pbg-intro-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    flex: 0 0 auto;
}

.pbg-intro-badges span,
.pbg-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--accent-light);
    color: #6d2fc8;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.pbg-editor-grid,
.pbg-bottom-grid {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.pbg-editor-grid {
    grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
    align-items: start;
}

.pbg-bottom-grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
    margin-top: 14px;
    align-items: start;
}

.pbg-upload-card,
.pbg-view-card,
.pbg-control-card,
.pbg-summary-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
    box-sizing: border-box;
}

.pbg-upload-card,
.pbg-control-card,
.pbg-summary-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pbg-view-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-color: var(--accent-mid);
    background: linear-gradient(135deg, #fff 0%, var(--accent-light) 100%);
    box-shadow: 0 10px 24px rgba(139, 60, 232, 0.12);
}

.pbg-section-heading,
.pbg-view-head,
.pbg-control-header,
.pbg-action-row,
.pbg-canvas-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pbg-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #1a1816;
    font-size: 15px;
    font-weight: 800;
}

.pbg-section-title i,
.pbg-upload-note i,
.pbg-privacy-note i {
    color: var(--accent-strong);
}

.pbg-view-copy,
.pbg-summary-note {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.pbg-upload-area {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 220px;
    padding: 22px 16px;
    border: 2px dashed #d9c9ef;
    border-radius: 16px;
    background:
        linear-gradient(45deg, rgba(184, 107, 255, 0.08) 25%, transparent 25%, transparent 75%, rgba(184, 107, 255, 0.08) 75%),
        linear-gradient(45deg, rgba(184, 107, 255, 0.08) 25%, transparent 25%, transparent 75%, rgba(184, 107, 255, 0.08) 75%),
        #fbf9ff;
    background-position: 0 0, 10px 10px, 0 0;
    background-size: 20px 20px, 20px 20px, auto;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    box-sizing: border-box;
}

.pbg-upload-area:hover,
.pbg-upload-area.dragover,
.pbg-upload-area:focus-visible {
    outline: none;
    border-color: var(--accent);
    background-color: #f7f0ff;
    box-shadow: 0 0 0 3px rgba(184, 107, 255, 0.12);
}

.pbg-upload-icon {
    color: var(--accent-strong);
    font-size: 34px;
}

.pbg-upload-text {
    color: #2d2a26;
    font-size: 15px;
    font-weight: 800;
}

.pbg-upload-hint {
    color: #8a817b;
    font-size: 12px;
    line-height: 1.5;
}

.pbg-upload-input {
    display: none;
}

.pbg-upload-note,
.pbg-privacy-note,
.pbg-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fbf9ff;
    color: #5f5a56;
    font-size: 12px;
    line-height: 1.6;
}

.pbg-view-surface {
    display: grid;
    min-height: 420px;
}

.pbg-empty-state,
.pbg-view-pane,
.pbg-compare-view {
    min-height: 100%;
}

.pbg-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px 18px;
    border: 1px dashed rgba(139, 60, 232, 0.35);
    border-radius: 16px;
    background:
        linear-gradient(45deg, rgba(255,255,255,0.8) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.8) 75%),
        linear-gradient(45deg, rgba(255,255,255,0.8) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.8) 75%),
        #f2edf8;
    background-position: 0 0, 10px 10px, 0 0;
    background-size: 20px 20px, 20px 20px, auto;
    color: #6f6964;
    text-align: center;
    box-sizing: border-box;
}

.pbg-empty-state i {
    color: var(--accent-strong);
    font-size: 38px;
}

.pbg-empty-state p {
    max-width: 520px;
    margin: 0;
    font-size: 14px;
    line-height: 1.65;
}

.pbg-view-pane {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pbg-canvas-frame,
.pbg-compare-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 360px;
    padding: 18px;
    border: 1px solid rgba(139, 60, 232, 0.22);
    border-radius: 16px;
    background-color: #f8f5fb;
    background-image:
        linear-gradient(45deg, #e7e1ee 25%, transparent 25%, transparent 75%, #e7e1ee 75%),
        linear-gradient(45deg, #e7e1ee 25%, transparent 25%, transparent 75%, #e7e1ee 75%);
    background-position: 0 0, 10px 10px;
    background-size: 20px 20px;
    box-sizing: border-box;
    overflow: hidden;
}

.pbg-canvas {
    display: block;
    max-width: 100%;
    max-height: 540px;
    width: auto;
    height: auto;
    border-radius: 10px;
    filter: drop-shadow(0 10px 22px rgba(31, 27, 24, 0.16));
}

.pbg-compare-view {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
}

.pbg-compare-panel::before {
    content: attr(data-label);
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(31, 27, 24, 0.72);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.pbg-compare-divider {
    width: 1px;
    border-radius: 999px;
    background: rgba(139, 60, 232, 0.26);
}

.pbg-compare-image {
    display: block;
    max-width: 100%;
    max-height: 360px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(31, 27, 24, 0.14));
}

.pbg-compare-toggle,
.pbg-reset-btn,
.pbg-download-btn,
.pbg-preset-btn {
    min-height: 40px;
    border: 1px solid #ddd7cb;
    border-radius: 10px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.pbg-compare-toggle,
.pbg-reset-btn,
.pbg-preset-btn {
    background: #fff;
    color: #3a332e;
}

.pbg-compare-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    white-space: nowrap;
}

.pbg-compare-toggle:hover:not(:disabled),
.pbg-reset-btn:hover,
.pbg-preset-btn:hover {
    border-color: var(--accent);
    background: #fbf8ff;
    box-shadow: 0 2px 8px rgba(139, 60, 232, 0.12);
}

.pbg-compare-toggle:disabled,
.pbg-download-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.pbg-preset-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.pbg-preset-btn {
    padding: 8px 10px;
    font-size: 12px;
}

.pbg-preset-btn.is-active {
    border-color: var(--accent-strong);
    background: var(--accent-light);
    color: #6d2fc8;
    box-shadow: inset 0 0 0 1px rgba(139, 60, 232, 0.12);
}

.pbg-control-grid,
.pbg-color-grid,
.pbg-summary-grid {
    display: grid;
    gap: 10px;
}

.pbg-control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pbg-color-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
}

.pbg-control-group,
.pbg-color-row {
    min-width: 0;
}

.pbg-control-label {
    color: #3a332e;
    font-size: 13px;
    font-weight: 800;
}

.pbg-control-value,
.pbg-color-chip,
.pbg-summary-value,
.pbg-detail-table td {
    font-family: var(--mono);
}

.pbg-control-value {
    color: #6d2fc8;
    font-size: 12px;
    font-weight: 800;
}

.pbg-slider {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-top: 8px;
    accent-color: var(--accent-strong);
    box-sizing: border-box;
}

.pbg-color-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #eee8dd;
    border-radius: 12px;
    background: #fff;
}

.pbg-color-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pbg-color-input {
    width: 42px;
    height: 36px;
    padding: 0;
    border: 1px solid #ddd7cb;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
}

.pbg-color-chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 9px;
    border-radius: 8px;
    background: #f7f4ef;
    color: #3a332e;
    font-size: 12px;
    font-weight: 800;
}

.pbg-check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #eee8dd;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}

.pbg-check-row input[type="checkbox"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--accent-strong);
}

.pbg-check-row span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pbg-check-row strong {
    color: #2d2a26;
    font-size: 13px;
}

.pbg-check-row small {
    color: #7b746f;
    font-size: 12px;
    line-height: 1.45;
}

.pbg-action-row {
    align-items: stretch;
}

.pbg-reset-btn,
.pbg-download-btn {
    flex: 1 1 0;
    padding: 10px 14px;
    font-size: 14px;
}

.pbg-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-color: var(--accent-strong);
    background: linear-gradient(135deg, var(--accent-strong) 0%, #b86bff 100%);
    color: #fff;
    box-shadow: 0 8px 18px rgba(139, 60, 232, 0.2);
}

.pbg-download-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(139, 60, 232, 0.28);
}

.pbg-notice {
    display: none;
    margin: 0;
}

.pbg-notice.is-visible {
    display: flex;
}

.pbg-notice.is-warning {
    background: #fff7e6;
    color: #775100;
}

.pbg-notice.is-error {
    background: #fff0f0;
    color: #9f2f2f;
}

.pbg-summary-card {
    border-color: var(--accent-mid);
    background: linear-gradient(135deg, #fff 0%, #fbf8ff 100%);
}

.pbg-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pbg-summary-item {
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #eee8dd;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.86);
}

.pbg-summary-item.is-kpi {
    grid-column: 1 / -1;
    border-color: rgba(139, 60, 232, 0.24);
    background: var(--accent-light);
}

.pbg-summary-label {
    margin-bottom: 3px;
    color: #7b746f;
    font-size: 12px;
    font-weight: 800;
}

.pbg-summary-value {
    color: #1f1b18;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.35;
    word-break: break-word;
}

.pbg-summary-item.is-kpi .pbg-summary-value {
    color: #5f24b3;
    font-size: 22px;
    letter-spacing: -0.04em;
}

.pbg-detail-table-wrap {
    overflow-x: auto;
    border: 1px solid #eee8dd;
    border-radius: 12px;
    background: #fff;
}

.pbg-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.pbg-detail-table th,
.pbg-detail-table td {
    padding: 9px 11px;
    border-bottom: 1px solid #f1ece4;
    text-align: left;
    vertical-align: top;
}

.pbg-detail-table tr:last-child th,
.pbg-detail-table tr:last-child td {
    border-bottom: 0;
}

.pbg-detail-table th {
    width: 38%;
    color: #6f6964;
    font-weight: 800;
    white-space: nowrap;
}

.pbg-detail-table td {
    color: #2d2a26;
    font-weight: 800;
}

.pbg-privacy-note {
    margin-top: 14px;
    border: 1px solid #eee8dd;
    background: #fffdf8;
}

.is-hidden {
    display: none !important;
}

@media (max-width: 1080px) {
    .pbg-editor-grid,
    .pbg-bottom-grid {
        grid-template-columns: 1fr;
    }

    .pbg-view-surface {
        min-height: 360px;
    }
}

@media (max-width: 768px) {
    .pbg-tool-intro,
    .pbg-view-head,
    .pbg-section-heading,
    .pbg-canvas-meta,
    .pbg-action-row {
        align-items: stretch;
        flex-direction: column;
    }

    .pbg-intro-badges {
        justify-content: flex-start;
    }

    .pbg-preset-row,
    .pbg-control-grid,
    .pbg-color-grid,
    .pbg-summary-grid,
    .pbg-compare-view {
        grid-template-columns: 1fr;
    }

    .pbg-compare-divider {
        width: auto;
        height: 1px;
    }

    .pbg-upload-area {
        min-height: 190px;
    }

    .pbg-canvas-frame,
    .pbg-compare-panel {
        min-height: 280px;
    }

    .pbg-compare-toggle,
    .pbg-reset-btn,
    .pbg-download-btn,
    .pbg-preset-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    #tool-png-border-generator,
    .pbg-editor-grid,
    .pbg-bottom-grid,
    .pbg-upload-card,
    .pbg-view-card,
    .pbg-control-card,
    .pbg-summary-card {
        max-width: 100%;
        overflow-x: hidden;
    }

    .pbg-upload-card,
    .pbg-view-card,
    .pbg-control-card,
    .pbg-summary-card {
        padding: 14px;
    }

    .pbg-canvas-frame,
    .pbg-compare-panel {
        padding: 12px;
        min-height: 240px;
    }

    .pbg-detail-table th,
    .pbg-detail-table td {
        padding: 8px;
        font-size: 12px;
    }
}

.pbg-tool,
.pbg-opacity-group {
    min-width: 0;
}
