/* ============================================
   Beta Notes Feedback Tool — Styles
   Drop-in component: 1 CSS + 1 JS per page
   ============================================ */

/* --- Floating Button --- */
.beta-notes-btn {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #DC3545;
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Merriweather', serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 4px 16px rgba(220, 53, 69, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    animation: betaNotesPulse 3s ease-in-out infinite;
}

.beta-notes-btn:hover {
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 6px 24px rgba(220, 53, 69, 0.55);
}

.beta-notes-btn.panel-open {
    animation: none;
    opacity: 0.7;
    transform: translateY(-50%) scale(0.92);
}

@keyframes betaNotesPulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(220, 53, 69, 0.4); }
    50% { box-shadow: 0 4px 28px rgba(220, 53, 69, 0.7); }
}

/* --- Side Panel --- */
.beta-notes-panel {
    position: fixed;
    right: -400px;
    top: 50%;
    transform: translateY(-50%);
    width: 380px;
    max-height: 80vh;
    background: #1a1a1a;
    border: 1px solid #333;
    border-right: none;
    border-radius: 12px 0 0 12px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
    transition: right 0.3s ease;
    font-family: 'Merriweather', -apple-system, sans-serif;
    color: #e0e0e0;
}

.beta-notes-panel.open {
    right: 0;
}

/* --- Panel Header --- */
.beta-notes-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #2a2a2a;
    flex-shrink: 0;
}

.beta-notes-panel-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.beta-notes-close-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}

.beta-notes-close-btn:hover {
    color: #fff;
}

/* --- Tabs --- */
.beta-notes-tabs {
    display: flex;
    flex-shrink: 0;
    border-bottom: 1px solid #2a2a2a;
    background: #141414;
}

.beta-notes-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 10px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #777;
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.beta-notes-tab svg {
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.beta-notes-tab:hover {
    color: #bbb;
    background: rgba(255,255,255,0.03);
}

.beta-notes-tab:hover svg {
    opacity: 0.8;
}

.beta-notes-tab.active {
    color: #fff;
    border-bottom-color: #DC3545;
    background: rgba(220, 53, 69, 0.06);
}

.beta-notes-tab.active svg {
    opacity: 1;
    stroke: #DC3545;
}

/* Note count badge */
.beta-notes-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #DC3545;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

/* --- Panel Body (scrollable) --- */
.beta-notes-panel-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.beta-notes-panel-body::-webkit-scrollbar {
    width: 6px;
}

.beta-notes-panel-body::-webkit-scrollbar-track {
    background: transparent;
}

.beta-notes-panel-body::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

/* --- Tab Views --- */
.beta-notes-view {
    display: none;
    padding: 14px 18px;
}

.beta-notes-view.active {
    display: block;
}

/* --- Section Labels --- */
.beta-notes-section-label {
    font-size: 11px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 6px;
}

.beta-notes-section {
    margin-bottom: 14px;
}

/* --- Form Row (Category + Priority side-by-side) --- */
.beta-notes-form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.beta-notes-field {
    flex: 1;
    min-width: 0;
}

.beta-notes-field select {
    width: 100%;
    padding: 8px 10px;
    background: #222;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
}

.beta-notes-field select:focus {
    outline: none;
    border-color: #DC3545;
}

/* --- Location Picker Button --- */
.beta-notes-location-btn {
    width: 100%;
    padding: 10px 14px;
    border: 1px dashed #444;
    border-radius: 8px;
    background: #1e1e1e;
    color: #888;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.beta-notes-location-btn:hover {
    border-color: #DC3545;
    color: #e0e0e0;
}

.beta-notes-location-btn svg {
    flex-shrink: 0;
    opacity: 0.5;
}

.beta-notes-location-btn:hover svg {
    opacity: 1;
    stroke: #DC3545;
}

/* --- Location Indicator --- */
.beta-notes-location-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #1e2e1e;
    border: 1px solid #28a745;
    border-radius: 6px;
    font-size: 11px;
    color: #8fdf8f;
}

.beta-notes-location-indicator.visible {
    display: flex;
}

.beta-notes-location-indicator .check {
    font-size: 14px;
    flex-shrink: 0;
}

.beta-notes-location-indicator .desc {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.beta-notes-location-indicator .clear-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    flex-shrink: 0;
}

.beta-notes-location-indicator .clear-btn:hover {
    color: #DC3545;
}

/* --- Priority Chips --- */
.beta-notes-priority-chips {
    display: flex;
    gap: 4px;
}

.beta-notes-priority-chip {
    flex: 1;
    padding: 7px 0;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    background: #222;
    color: #999;
    font-size: 11px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
}

.beta-notes-priority-chip:hover {
    border-color: #555;
    color: #e0e0e0;
}

.beta-notes-priority-chip.selected[data-priority="low"] {
    background: #2d2d2d;
    border-color: #888;
    color: #ccc;
}

.beta-notes-priority-chip.selected[data-priority="medium"] {
    background: #3d3520;
    border-color: #f0ad4e;
    color: #f0ad4e;
}

.beta-notes-priority-chip.selected[data-priority="high"] {
    background: #3d2020;
    border-color: #DC3545;
    color: #DC3545;
}

/* --- Textarea --- */
.beta-notes-view textarea {
    width: 100%;
    min-height: 90px;
    padding: 10px 12px;
    background: #222;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.beta-notes-view textarea:focus {
    outline: none;
    border-color: #DC3545;
}

/* --- Textarea Footer (screenshot + char count) --- */
.beta-notes-textarea-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    margin-bottom: 14px;
}

.beta-notes-screenshot-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #888;
    cursor: pointer;
    transition: color 0.15s;
}

.beta-notes-screenshot-toggle:hover {
    color: #ccc;
}

.beta-notes-screenshot-toggle input[type="checkbox"] {
    accent-color: #DC3545;
    width: 14px;
    height: 14px;
    cursor: pointer;
    margin: 0;
}

.beta-notes-screenshot-toggle svg {
    flex-shrink: 0;
    opacity: 0.5;
}

.beta-notes-char-count {
    font-size: 10px;
    color: #555;
}

.beta-notes-char-count.near-limit {
    color: #f0ad4e;
}

.beta-notes-char-count.at-limit {
    color: #DC3545;
}

/* --- Submit Button --- */
.beta-notes-submit-btn {
    width: 100%;
    padding: 11px;
    background: #DC3545;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.beta-notes-submit-btn:hover {
    background: #c82333;
}

.beta-notes-submit-btn:active {
    transform: scale(0.98);
}

.beta-notes-submit-btn:disabled {
    background: #555;
    cursor: not-allowed;
}

/* --- History Toolbar --- */
.beta-notes-history-toolbar {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #2a2a2a;
}

.beta-notes-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #1e1e1e;
    color: #aaa;
    font-size: 11px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.beta-notes-toolbar-btn svg {
    flex-shrink: 0;
}

.beta-notes-toolbar-btn:hover {
    background: #2a2a2a;
    border-color: #555;
    color: #e0e0e0;
}

.beta-notes-toolbar-btn.danger {
    border-color: #3d2020;
    color: #994040;
}

.beta-notes-toolbar-btn.danger:hover {
    background: rgba(220, 53, 69, 0.1);
    border-color: #DC3545;
    color: #DC3545;
}

.beta-notes-toolbar-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* --- History List --- */
.beta-notes-history-empty {
    text-align: center;
    color: #555;
    font-size: 13px;
    padding: 32px 16px;
}

.beta-notes-history-item {
    position: relative;
    padding: 10px 12px;
    padding-right: 34px;
    background: #1e1e1e;
    border-radius: 8px;
    border-left: 3px solid #555;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

/* --- Delete Button (red X) --- */
.beta-notes-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(220, 53, 69, 0.12);
    color: #DC3545;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s, transform 0.1s;
    padding: 0;
}

.beta-notes-history-item:hover .beta-notes-delete-btn {
    opacity: 1;
}

.beta-notes-delete-btn:hover {
    background: #DC3545;
    color: #fff;
    transform: scale(1.1);
}

.beta-notes-delete-btn:active {
    transform: scale(0.95);
}

.beta-notes-history-item:hover {
    background: #242424;
}

.beta-notes-history-item.status-new { border-left-color: #DC3545; }
.beta-notes-history-item.status-under_review { border-left-color: #f0ad4e; }
.beta-notes-history-item.status-planned { border-left-color: #5bc0de; }
.beta-notes-history-item.status-implemented { border-left-color: #28a745; }
.beta-notes-history-item.status-declined { border-left-color: #888; }

.beta-notes-history-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.beta-notes-history-date {
    font-size: 10px;
    color: #666;
}

.beta-notes-history-note {
    font-size: 12px;
    color: #bbb;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.beta-notes-history-item.expanded .beta-notes-history-note {
    -webkit-line-clamp: unset;
}

.beta-notes-history-admin-note {
    margin-top: 8px;
    padding: 8px;
    background: #1a1a2e;
    border-radius: 4px;
    font-size: 11px;
    color: #8888cc;
    display: none;
}

.beta-notes-history-item.expanded .beta-notes-history-admin-note {
    display: block;
}

/* --- Status Badge --- */
.beta-notes-status-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.beta-notes-status-badge.status-new { background: #3d2020; color: #DC3545; }
.beta-notes-status-badge.status-under_review { background: #3d3520; color: #f0ad4e; }
.beta-notes-status-badge.status-planned { background: #1e3040; color: #5bc0de; }
.beta-notes-status-badge.status-implemented { background: #1e2e1e; color: #28a745; }
.beta-notes-status-badge.status-declined { background: #2d2d2d; color: #888; }

/* --- Category Badge --- */
.beta-notes-category-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 600;
    background: #2a2a2a;
    color: #aaa;
}

/* --- Priority Dot --- */
.beta-notes-priority-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.beta-notes-priority-dot.priority-low { background: #888; }
.beta-notes-priority-dot.priority-medium { background: #f0ad4e; }
.beta-notes-priority-dot.priority-high { background: #DC3545; }

/* --- Picker Overlay --- */
.beta-notes-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    cursor: crosshair;
    background: transparent;
}

/* --- Picker Highlight --- */
.beta-notes-picker-highlight {
    position: fixed;
    border: 2px solid #DC3545;
    border-radius: 4px;
    background: rgba(220, 53, 69, 0.08);
    pointer-events: none;
    z-index: 9999;
    transition: top 0.05s, left 0.05s, width 0.05s, height 0.05s;
}

/* --- Picker Banner --- */
.beta-notes-picker-banner {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 24px;
    background: #1a1a1a;
    border: 1px solid #DC3545;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 14px;
    font-family: 'Merriweather', sans-serif;
    z-index: 10002;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

.beta-notes-picker-banner kbd {
    background: #333;
    border: 1px solid #555;
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 12px;
    font-family: monospace;
}

/* --- Toast Notifications --- */
.beta-notes-toast {
    position: fixed;
    bottom: 100px;
    right: 24px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Merriweather', sans-serif;
    z-index: 10003;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

.beta-notes-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.beta-notes-toast.success {
    background: #1e2e1e;
    border: 1px solid #28a745;
    color: #8fdf8f;
}

.beta-notes-toast.error {
    background: #3d2020;
    border: 1px solid #DC3545;
    color: #ff9999;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .beta-notes-panel {
        width: 100vw;
        right: -100vw;
        border-radius: 0;
        max-height: 100vh;
        top: 0;
        transform: none;
    }

    .beta-notes-panel.open {
        right: 0;
    }

    .beta-notes-btn {
        right: 12px;
        width: 56px;
        height: 56px;
        font-size: 11px;
    }

    .beta-notes-toast {
        right: 12px;
        bottom: 80px;
    }

    .beta-notes-form-row {
        flex-direction: column;
        gap: 10px;
    }
}
