/**
 * Prompt Manager - User Dashboard Styles
 */

/* Container */
.pm-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Header */
.pm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.pm-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #1e1e1e;
}

.pm-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

/* Member Badge */
.pm-member-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
}

/* Premium Member Badge - Sparkly celebration style */
.pm-member-premium {
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 50%, #ffd700 100%);
    background-size: 200% 200%;
    animation: pm-shimmer 2s ease-in-out infinite;
    color: #7c5c00;
    box-shadow: 0 2px 8px rgba(255, 179, 71, 0.4);
    border: 1px solid rgba(255, 215, 0, 0.5);
}

.pm-member-premium .pm-sparkle {
    font-size: 11px;
    color: #d35400;
    animation: pm-sparkle-pulse 1.5s ease-in-out infinite;
    text-shadow: 0 0 2px rgba(255, 100, 0, 0.5);
}

@keyframes pm-shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes pm-sparkle-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

/* Free Member Badge - Simple gray style */
.pm-member-free {
    background: #f0f0f0;
    color: #777;
    border: 1px solid #ddd;
}

/* Premium Help Button & Popup */
.pm-premium-help-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #ccc;
    background: #fff;
    color: #888;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-left: 6px;
    transition: all 0.2s;
}

.pm-premium-help-btn:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.pm-premium-help-popup {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 16px;
    min-width: 250px;
    z-index: 100;
}

.pm-premium-help-popup.show {
    display: block;
}

.pm-premium-help-header {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.pm-premium-help-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pm-premium-help-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    color: #555;
}

.pm-premium-help-list .dashicons {
    color: #4caf50;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.pm-premium-help-footer {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-size: 12px;
    color: #667eea;
    font-weight: 500;
}

/* Free Member Help Button & Popup */
.pm-free-help-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #ccc;
    background: #fff;
    color: #888;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-left: 6px;
    transition: all 0.2s;
}

.pm-free-help-btn:hover {
    background: #666;
    color: #fff;
    border-color: #666;
}

.pm-free-help-popup {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 16px;
    min-width: 260px;
    z-index: 100;
}

.pm-free-help-popup.show {
    display: block;
}

.pm-free-help-header {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
}

.pm-free-help-header.pm-premium-color {
    color: #667eea;
}

.pm-free-help-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pm-free-help-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 13px;
    color: #555;
}

.pm-free-help-list .dashicons-yes-alt {
    color: #4caf50;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.pm-free-help-list.pm-premium-list .dashicons-star-filled {
    color: #ffc107;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.pm-free-help-divider {
    height: 1px;
    background: #eee;
    margin: 12px 0;
}

.pm-free-help-upgrade-btn {
    display: block;
    margin-top: 12px;
    padding: 8px 12px;
    background: #667eea;
    color: #fff !important;
    text-align: center;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none !important;
    transition: background 0.2s;
}

.pm-free-help-upgrade-btn:hover {
    background: #5a6fd6;
}

/* Premium Only Button Style */
.pm-premium-only-btn {
    opacity: 0.85;
}

.pm-premium-badge-sm {
    display: inline-block;
    padding: 2px 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    border-radius: 3px;
    margin-left: 6px;
    text-transform: uppercase;
}

/* Premium Feature Note */
.pm-premium-note {
    margin: 8px 0 0 0;
    padding: 0;
    font-size: 12px;
    color: #888;
}

.pm-premium-note a {
    color: #667eea;
    text-decoration: none;
}

.pm-premium-note a:hover {
    text-decoration: underline;
}

/* Usage Stats */
.pm-usage-stats {
    display: flex;
    gap: 16px;
    margin-right: 16px;
}

.pm-usage-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
}

.pm-usage-item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #888;
}

.pm-usage-item .pm-limit-reached {
    color: #d63638;
    font-weight: 600;
}

.pm-header-actions {
    display: flex;
    align-items: center;
}

/* Buttons */
.pm-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.pm-btn-primary {
    background: #0073aa;
    color: #fff;
}

.pm-btn-primary:hover {
    background: #005a87;
    color: #fff;
}

.pm-btn-secondary {
    background: #f0f0f0;
    color: #1e1e1e;
}

.pm-btn-secondary:hover {
    background: #e0e0e0;
}

.pm-btn-icon {
    padding: 6px;
    background: transparent;
    color: #666;
}

.pm-btn-icon:hover {
    background: #f0f0f0;
    color: #0073aa;
}

.pm-btn-icon .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Filters */
.pm-filters {
    margin-bottom: 24px;
}

/* Level 1: Primary Filter (All / Favorites) */
.pm-filter-primary {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.pm-filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pm-filter-tab:hover {
    border-color: #333;
    color: #333;
}

.pm-filter-tab.active {
    background: #1e1e1e;
    border-color: #1e1e1e;
    color: #fff;
}

.pm-filter-tab .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.pm-filter-tab[data-filter="favorites"] .dashicons {
    color: #f0b849;
}

.pm-filter-tab[data-filter="favorites"].active .dashicons {
    color: #fff;
}

.pm-filter-tab .pm-count {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.pm-filter-tab.active .pm-count {
    background: rgba(255, 255, 255, 0.25);
}

/* Level 2: Secondary Filter (Categories) */
.pm-filter-secondary {
    margin-bottom: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.pm-filter-secondary .pm-category-tabs {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.pm-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.pm-category-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pm-category-tab:hover {
    border-color: #999;
}

.pm-category-tab.active {
    background: #fff;
    border-color: #1e1e1e;
    border-width: 2px;
    color: #1e1e1e;
    font-weight: 600;
}

.pm-category-tab .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.pm-category-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--category-color, #0073aa);
}

.pm-count {
    background: rgba(0, 0, 0, 0.08);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.pm-category-tab.active .pm-count {
    background: rgba(0, 0, 0, 0.12);
}

.pm-category-add {
    background: transparent;
    border-style: dashed;
}

.pm-category-add:hover {
    background: #f0f0f0;
}

.pm-category-manage {
    background: transparent;
    border-color: transparent;
    color: #666;
}

.pm-category-manage:hover {
    background: #f0f0f0;
    border-color: transparent;
}

/* Category Management List */
.pm-category-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pm-category-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background 0.2s;
}

.pm-category-list-item:hover {
    background: #f0f0f0;
}

.pm-category-list-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pm-category-list-info .pm-category-dot {
    width: 12px;
    height: 12px;
}

.pm-category-list-name {
    font-weight: 500;
    color: #333;
}

.pm-category-list-count {
    font-size: 12px;
    color: #888;
}

.pm-category-list-actions {
    display: flex;
    gap: 4px;
}

.pm-category-list-actions .pm-btn-icon {
    padding: 6px;
}

.pm-category-list-actions .pm-btn-icon:hover {
    background: #e0e0e0;
}

.pm-category-list-actions .pm-btn-category-delete:hover {
    background: #fce8e8;
    color: #dc3232;
}

.pm-empty-message {
    text-align: center;
    color: #888;
    padding: 20px;
}

.pm-btn-category-edit,
.pm-btn-category-delete {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.pm-btn-category-edit:hover {
    background: #e8f4fc;
}

.pm-btn-category-delete:hover {
    background: #fce8e8;
}

.pm-btn-category-edit .dashicons,
.pm-btn-category-delete .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.pm-btn-category-edit .dashicons {
    color: #0073aa;
}

.pm-btn-category-delete .dashicons {
    color: #dc3232;
}

/* Search Bar */
.pm-search-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.pm-search-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.pm-search-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.pm-select {
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    min-width: 140px;
}

.pm-select:focus {
    outline: none;
    border-color: #0073aa;
}

/* Prompts List */
.pm-prompts-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* Prompt Card */
.pm-prompt-card {
    position: relative;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    padding-top: 50px;
    padding-left: 46px;
    transition: all 0.2s ease;
}

.pm-prompt-card:hover {
    border-color: #0073aa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 使うボタン（右上・モノトーン） */
.pm-copy-wrapper {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 1;
}

.pm-btn-copy-main {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #f5f5f5;
    color: #555;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pm-btn-copy-main:hover {
    background: #e8e8e8;
    border-color: #ccc;
    color: #333;
}

.pm-btn-copy-main:active {
    background: #ddd;
}

.pm-btn-copy-main .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.pm-copy-label {
    font-weight: 500;
}

.pm-copy-message {
    display: none;
    margin-top: 4px;
    padding: 4px 8px;
    background: #1e1e1e;
    color: #fff;
    font-size: 11px;
    border-radius: 4px;
    white-space: nowrap;
    animation: pm-fade-in 0.2s ease;
}

.pm-copy-message.show {
    display: block;
}

@keyframes pm-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Selection Checkbox */
.pm-card-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    cursor: pointer;
}

.pm-card-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.pm-checkbox-mark {
    display: block;
    width: 22px;
    height: 22px;
    background: #fff;
    border: 2px solid #ccc;
    border-radius: 4px;
    transition: all 0.2s;
}

.pm-card-checkbox:hover .pm-checkbox-mark {
    border-color: #0073aa;
}

.pm-card-checkbox input:checked ~ .pm-checkbox-mark {
    background: #0073aa;
    border-color: #0073aa;
}

.pm-checkbox-mark::after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.pm-card-checkbox input:checked ~ .pm-checkbox-mark::after {
    display: block;
}

/* Selected Card State */
.pm-prompt-card.pm-selected {
    border-color: #0073aa;
    background: #f0f7fc;
}

/* Bulk Actions Bar */
.pm-bulk-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.pm-bulk-actions-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pm-bulk-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pm-select-all-label {
    font-weight: 500;
}

.pm-select-all-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 6px;
    vertical-align: middle;
}

.pm-selected-count {
    color: #666;
    font-size: 14px;
}

.pm-btn-danger {
    background: #d63638;
    color: #fff;
}

.pm-btn-danger:hover {
    background: #b32d2e;
    color: #fff;
}

/* Small spinner for buttons */
.pm-spinner-small {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #ffffff40;
    border-top-color: #fff;
    border-radius: 50%;
    animation: pm-spin 0.8s linear infinite;
    vertical-align: middle;
}

.pm-prompt-header {
    margin-bottom: 12px;
}

.pm-prompt-title-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}

.pm-btn-favorite {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #ccc;
    transition: color 0.2s;
    flex-shrink: 0;
}

.pm-btn-favorite:hover,
.pm-btn-favorite.active {
    color: #f0b849;
}

.pm-btn-favorite .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.pm-prompt-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e1e1e;
    line-height: 1.4;
}

.pm-prompt-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pm-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.pm-badge-category {
    background: var(--category-color, #0073aa);
    color: #fff;
}

.pm-badge-purpose {
    background: #f0f0f0;
    color: #555;
}

.pm-prompt-content {
    margin-bottom: 16px;
}

.pm-prompt-content p {
    margin: 0;
    color: #555;
    font-size: 14px;
    line-height: 1.6;
}

.pm-content-full {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.pm-btn-expand {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding: 0;
    background: none;
    border: none;
    color: #0073aa;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s;
}

.pm-btn-expand:hover {
    color: #005a87;
}

.pm-btn-expand .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.pm-prompt-content.expanded .pm-content-preview {
    display: none;
}

.pm-prompt-content.expanded .pm-content-full {
    display: block !important;
}

.pm-prompt-content.expanded .pm-expand-more {
    display: none;
}

.pm-prompt-content.expanded .pm-expand-less {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
}

.pm-prompt-notes {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 12px;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}

.pm-prompt-notes .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: #888;
    flex-shrink: 0;
    margin-top: 1px;
}

.pm-prompt-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.pm-prompt-meta {
    display: flex;
    gap: 12px;
}

.pm-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #888;
}

.pm-meta-item .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.pm-prompt-actions {
    display: flex;
    gap: 4px;
}

/* Empty State */
.pm-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.pm-empty-state .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    color: #ccc;
}

.pm-empty-state p {
    margin: 8px 0;
    font-size: 14px;
}

.pm-empty-state-clickable {
    cursor: pointer;
    border: 2px dashed #ddd;
    border-radius: 12px;
    transition: all 0.2s;
}

.pm-empty-state-clickable:hover {
    border-color: #667eea;
    background: #fafbff;
}

.pm-empty-state-clickable:hover .dashicons {
    color: #667eea;
}

.pm-empty-state-hint {
    color: #aaa;
    font-size: 13px !important;
}

.pm-empty-state-clickable:hover .pm-empty-state-hint {
    color: #667eea;
}

/* Loading */
.pm-loading {
    text-align: center;
    padding: 40px;
    color: #888;
}

.pm-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f0f0f0;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: pm-spin 0.8s linear infinite;
    margin-right: 8px;
}

@keyframes pm-spin {
    to { transform: rotate(360deg); }
}

/* Pagination */
.pm-pagination {
    text-align: center;
    margin-top: 30px;
}

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

.pm-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.pm-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.pm-modal-small {
    max-width: 400px;
}

.pm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.pm-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.pm-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #888;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.pm-modal-close:hover {
    color: #333;
}

.pm-modal-body {
    padding: 24px;
    overflow-y: auto;
}

.pm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
    background: #f9f9f9;
}

.pm-modal-warning {
    padding: 12px 24px;
    color: #dc3232;
    font-size: 13px;
    text-align: center;
    background: #fef7f7;
    border-top: 1px solid #f5c6c6;
}

.pm-premium-link-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: #555;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 400;
    transition: background 0.2s;
}

.pm-premium-link-btn:hover {
    background: #333;
    color: #fff !important;
}

/* AI Refine Comparison Modal */
.pm-refine-compare-content {
    max-width: 900px;
    width: 95%;
}

.pm-compare-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.pm-compare-panel {
    display: flex;
    flex-direction: column;
}

.pm-compare-label {
    font-weight: 600;
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
    padding: 6px 10px;
    background: #f5f5f5;
    border-radius: 4px;
}

.pm-compare-text {
    flex: 1;
    padding: 12px;
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
}

.pm-compare-panel:first-child .pm-compare-label {
    background: #f0f0f0;
    color: #666;
}

.pm-compare-panel:last-child .pm-compare-label {
    background: #e8f4e8;
    color: #2e7d32;
}

.pm-compare-panel:last-child .pm-compare-text {
    background: #f9fdf9;
    border-color: #c8e6c9;
}

.pm-compare-footer {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* Mobile responsive for comparison modal */
@media (max-width: 768px) {
    .pm-compare-container {
        grid-template-columns: 1fr;
    }

    .pm-compare-text {
        max-height: 200px;
    }

    .pm-compare-footer {
        flex-direction: column;
    }

    .pm-compare-footer .pm-btn {
        width: 100%;
    }
}

/* Form */
.pm-form-group {
    margin-bottom: 20px;
}

.pm-form-group:last-child {
    margin-bottom: 0;
}

.pm-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: #333;
}

.pm-form-group label .required {
    color: #d63638;
}

.pm-form-group input[type="text"],
.pm-form-group input[type="email"],
.pm-form-group select,
.pm-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.pm-form-group input:focus,
.pm-form-group select:focus,
.pm-form-group textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.pm-form-group textarea {
    resize: vertical;
    min-height: 150px;
    line-height: 1.6;
}

.pm-form-hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: #888;
}

.pm-form-actions {
    display: flex;
    align-items: center;
    margin-top: 8px;
    position: relative;
}

.pm-form-actions .pm-form-hint {
    margin: 0;
}

.pm-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.pm-premium-feature-hint {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #999;
}

.pm-premium-feature-hint .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Paper reference link */
/* AI Refine Help Button & Popup */
.pm-refine-help-btn {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #ccc;
    background: #fff;
    color: #888;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    margin-left: 4px;
    padding: 0;
    line-height: 16px;
    transition: all 0.2s;
}

.pm-refine-help-btn:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.pm-refine-help-popup {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 8px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    padding: 10px 12px;
    font-size: 12px;
    color: #555;
    line-height: 1.5;
    max-width: 280px;
    z-index: 100;
}

.pm-refine-help-popup.show {
    display: block;
}

.pm-refine-help-popup a {
    color: #0073aa;
    text-decoration: underline;
}

.pm-form-row {
    display: flex;
    gap: 16px;
}

.pm-form-half {
    flex: 1;
}

/* Category Select with Inline Add Button */
.pm-category-select-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pm-category-select-wrapper select {
    flex: 1;
    width: auto;
}

.pm-btn-add-category-inline {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pm-btn-add-category-inline:hover {
    background: #005a87;
}

.pm-btn-add-category-inline .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.pm-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal !important;
}

.pm-checkbox-label input[type="checkbox"] {
    width: auto;
}

.pm-checkbox-label .dashicons {
    color: #f0b849;
}

/* Form Hint */
.pm-form-hint {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 4px;
    margin-left: 28px;
}

/* Notes Textarea */
#pm-prompt-notes {
    resize: vertical;
    min-height: 50px;
}

#pm-prompt-notes::placeholder {
    color: #aaa;
    font-style: italic;
}

/* Color Input */
.pm-color-presets {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.pm-color-preset {
    width: 28px;
    height: 28px;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.15s, box-shadow 0.15s;
}

.pm-color-preset:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.pm-color-preset.selected {
    border-color: #333;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #333;
}

.pm-form-group input[type="color"] {
    width: 60px;
    height: 40px;
    padding: 4px;
    cursor: pointer;
}

/* Toast Notification */
.pm-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e1e1e;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 100001;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: pm-toast-in 0.3s ease;
}

@keyframes pm-toast-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.pm-toast .dashicons {
    color: #46b450;
}

/* Login/Membership Required */
.pm-login-required {
    text-align: center;
    padding: 40px;
    color: #888;
}

.pm-auth-required {
    text-align: center;
    padding: 60px 20px;
    max-width: 400px;
    margin: 0 auto;
}

.pm-auth-icon {
    margin-bottom: 20px;
}

.pm-auth-icon .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: #ccc;
}

.pm-auth-required h3 {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 600;
    color: #1e1e1e;
}

.pm-auth-required p {
    margin: 0 0 24px;
    color: #666;
    font-size: 14px;
}

.pm-auth-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.pm-auth-buttons .pm-btn {
    min-width: 120px;
    justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
    .pm-container {
        padding: 16px;
    }

    .pm-header {
        flex-direction: column;
        align-items: stretch;
    }

    .pm-header-left {
        margin-bottom: 8px;
        flex-wrap: wrap;
    }

    .pm-header-actions {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .pm-usage-stats {
        margin-right: 0;
        justify-content: center;
    }

    .pm-header-actions .pm-btn {
        flex: 1;
        justify-content: center;
    }

    /* Primary filter on mobile */
    .pm-filter-primary {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .pm-filter-tab {
        flex-shrink: 0;
        padding: 8px 14px;
        font-size: 13px;
    }

    /* Secondary filter on mobile */
    .pm-filter-secondary {
        padding: 8px;
    }

    /* Category tabs - horizontal scroll on mobile */
    .pm-category-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 8px;
        margin-bottom: 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .pm-category-tab,
    .pm-category-tab-wrapper {
        flex-shrink: 0;
    }

    /* Hide edit/delete on mobile - use long press or separate UI */
    .pm-category-actions {
        display: none !important;
    }

    .pm-search-bar {
        flex-direction: column;
    }

    .pm-search-input,
    .pm-select {
        width: 100%;
    }

    .pm-prompts-list {
        grid-template-columns: 1fr;
    }

    .pm-form-row {
        flex-direction: column;
    }

    .pm-form-actions {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    /* Modal - full screen on mobile */
    .pm-modal {
        padding: 0;
        align-items: stretch;
    }

    .pm-modal-content {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile browsers */
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
    }

    .pm-modal-header {
        padding: 10px 16px;
        flex-shrink: 0;
        border-bottom: 1px solid #e0e0e0;
    }

    .pm-modal-title {
        font-size: 15px;
    }

    .pm-modal-close {
        font-size: 24px;
        padding: 0 4px;
    }

    .pm-modal-body {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 12px 16px;
        overscroll-behavior: contain;
        min-height: 0; /* Important for flex scrolling */
    }

    /* Compact form on mobile */
    .pm-modal-body .pm-form-group {
        margin-bottom: 12px;
    }

    .pm-modal-body .pm-form-group label {
        margin-bottom: 4px;
        font-size: 13px;
    }

    .pm-modal-body .pm-form-group input[type="text"],
    .pm-modal-body .pm-form-group select {
        padding: 8px 10px;
    }

    .pm-modal-body textarea {
        min-height: 80px;
        max-height: 150px;
        padding: 10px;
    }

    .pm-modal-footer {
        padding: 10px 16px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        flex-shrink: 0;
        border-top: 1px solid #e0e0e0;
        background: #fff;
    }

    .pm-modal-footer .pm-btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    /* Prevent iOS zoom on input focus - must be 16px or larger */
    .pm-form-group input[type="text"],
    .pm-form-group input[type="email"],
    .pm-form-group input[type="password"],
    .pm-form-group textarea,
    .pm-form-group select,
    #pm-search {
        font-size: 16px !important;
        transform: scale(1);
    }

    /* Prevent zoom on touch */
    .pm-modal-content {
        touch-action: pan-y;
    }
}

@media (max-width: 480px) {
    .pm-prompt-footer {
        flex-direction: column;
        gap: 12px;
    }

    .pm-prompt-meta {
        width: 100%;
        justify-content: center;
    }

    .pm-prompt-actions {
        width: 100%;
        justify-content: center;
    }
}

/* ===========================================
   Preview Mode Styles (Non-logged-in users)
   =========================================== */

/* Preview Banner */
.pm-preview-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #f5f5f5;
    color: #555;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.pm-preview-banner-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
}

.pm-preview-banner-content .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #888;
}

.pm-preview-banner-actions {
    display: flex;
    gap: 8px;
}

.pm-btn-light {
    background: #fff;
    color: #555;
    border: 1px solid #ccc;
}

.pm-btn-light:hover {
    background: #f0f0f0;
    color: #333;
}

.pm-btn-dark {
    background: #555;
    color: #fff;
    border: 1px solid #555;
}

.pm-btn-dark:hover {
    background: #444;
    color: #fff;
}

.pm-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Preview Card Overlay Effect */
.pm-preview-card {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pm-preview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pm-preview-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    pointer-events: none;
    border-radius: 10px;
    transition: background 0.2s;
}

.pm-preview-card:hover::after {
    background: rgba(102, 126, 234, 0.05);
}

/* Preview Mode Interactive Elements */
.pm-preview-mode .pm-preview-action {
    cursor: pointer;
}

.pm-preview-mode .pm-search-input {
    cursor: pointer;
}

/* Login Modal */
.pm-login-modal .pm-modal-header {
    text-align: center;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.pm-login-modal .pm-modal-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 20px;
}

.pm-login-modal .pm-modal-title .dashicons {
    color: #667eea;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.pm-login-modal-text {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
}

.pm-feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.pm-feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #333;
}

.pm-feature-list li:last-child {
    border-bottom: none;
}

.pm-feature-list .dashicons {
    color: #4caf50;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.pm-login-modal-footer {
    display: block;
    text-align: center;
    padding: 20px 24px;
}

.pm-login-modal-footer .pm-btn-block {
    margin-bottom: 0;
}

.pm-btn-block {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
}

.pm-login-link {
    display: block;
    margin-top: 16px;
    margin-bottom: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.pm-login-link a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.pm-login-link a:hover {
    text-decoration: underline;
}

/* Modal Open State */
body.pm-modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

/* Ensure modal scrolls properly on mobile when body is fixed */
body.pm-modal-open .pm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Preview Mode Responsive */
@media (max-width: 600px) {
    .pm-preview-banner {
        flex-direction: column;
        text-align: center;
    }

    .pm-preview-banner-content {
        justify-content: center;
    }

    .pm-preview-banner-actions {
        width: 100%;
        justify-content: center;
    }
}
