/* ============================================================
   PCBanado Feedback Widget — CSS
   Theme: Dark tech / purple accent  (#0d0d1a / #7c6ff7)
   ============================================================ */

/* ---------- Variables ---------- */
:root {
    --pcbf-bg-panel:      #12121f;
    --pcbf-bg-input:      #1a1a2e;
    --pcbf-bg-chip:       #1e1e32;
    --pcbf-border:        rgba(124, 111, 247, 0.18);
    --pcbf-border-focus:  rgba(124, 111, 247, 0.6);
    --pcbf-accent:        #7c6ff7;
    --pcbf-accent-hover:  #9488fa;
    --pcbf-accent-dim:    rgba(124, 111, 247, 0.12);
    --pcbf-text:          #e8e8f0;
    --pcbf-text-muted:    #8585a0;
    --pcbf-text-label:    #acacc8;
    --pcbf-radius-sm:     8px;
    --pcbf-radius-md:     12px;
    --pcbf-radius-lg:     18px;
    --pcbf-shadow:        0 8px 40px rgba(0,0,0,0.55), 0 0 0 1px rgba(124,111,247,0.12);
    --pcbf-trigger-w:     140px;
    --pcbf-panel-w:       360px;
}

/* ---------- Wrapper ---------- */
#pcbf-wrapper {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--pcbf-text);
}

/* ---------- Trigger Button ---------- */
#pcbf-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--pcbf-accent);
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 20px rgba(124, 111, 247, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    white-space: nowrap;
}

#pcbf-trigger:hover {
    background: var(--pcbf-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(124, 111, 247, 0.6);
}

#pcbf-trigger:active {
    transform: translateY(0);
}

/* ---------- Panel ---------- */
#pcbf-panel {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 0;
    width: var(--pcbf-panel-w);
    background: var(--pcbf-bg-panel);
    border: 1px solid var(--pcbf-border);
    border-radius: var(--pcbf-radius-lg);
    box-shadow: var(--pcbf-shadow);
    overflow: hidden;
    transform: translateY(12px) scale(0.96);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.22s ease;
    max-height: 90vh;
    overflow-y: auto;
}

#pcbf-panel.pcbf-open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* scrollbar */
#pcbf-panel::-webkit-scrollbar { width: 4px; }
#pcbf-panel::-webkit-scrollbar-track { background: transparent; }
#pcbf-panel::-webkit-scrollbar-thumb { background: rgba(124,111,247,0.3); border-radius: 4px; }

/* ---------- Header ---------- */
.pcbf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 14px;
    border-bottom: 1px solid var(--pcbf-border);
    background: linear-gradient(135deg, rgba(124,111,247,0.08) 0%, transparent 100%);
}

.pcbf-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pcbf-logo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pcbf-accent);
    box-shadow: 0 0 6px var(--pcbf-accent);
    animation: pcbf-pulse 2.4s infinite;
}

.pcbf-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--pcbf-text);
    letter-spacing: 0.2px;
}

.pcbf-close-btn {
    background: none;
    border: 1px solid var(--pcbf-border);
    border-radius: var(--pcbf-radius-sm);
    color: var(--pcbf-text-muted);
    cursor: pointer;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    line-height: 1;
}

.pcbf-close-btn:hover {
    background: var(--pcbf-accent-dim);
    border-color: var(--pcbf-border-focus);
    color: var(--pcbf-accent);
}

/* ---------- Subtitle ---------- */
.pcbf-subtitle {
    margin: 0;
    padding: 12px 18px 8px;
    font-size: 12.5px;
    color: var(--pcbf-text-muted);
    line-height: 1.6;
}

/* ---------- Form sections ---------- */
.pcbf-section {
    padding: 8px 18px;
    position: relative;
}

.pcbf-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--pcbf-text-label);
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.pcbf-required {
    color: var(--pcbf-accent);
}

/* ---------- Chips ---------- */
.pcbf-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.pcbf-chip {
    background: var(--pcbf-bg-chip);
    border: 1px solid var(--pcbf-border);
    color: var(--pcbf-text-muted);
    border-radius: 50px;
    padding: 5px 13px;
    font-size: 12.5px;
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: inherit;
    white-space: nowrap;
}

.pcbf-chip:hover {
    border-color: rgba(124, 111, 247, 0.45);
    color: var(--pcbf-text);
    background: rgba(124, 111, 247, 0.08);
}

.pcbf-chip.active {
    background: var(--pcbf-accent);
    border-color: var(--pcbf-accent);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 12px rgba(124, 111, 247, 0.4);
}

/* ---------- Inputs & Textarea ---------- */
#pcbf-wrapper input[type="text"],
#pcbf-wrapper input[type="email"],
#pcbf-wrapper textarea {
    width: 100%;
    background: var(--pcbf-bg-input);
    border: 1px solid var(--pcbf-border);
    border-radius: var(--pcbf-radius-sm);
    color: var(--pcbf-text);
    font-family: inherit;
    font-size: 13.5px;
    padding: 9px 12px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: none;
    box-sizing: border-box;
    -webkit-appearance: none;
}

#pcbf-wrapper input[type="text"]::placeholder,
#pcbf-wrapper input[type="email"]::placeholder,
#pcbf-wrapper textarea::placeholder {
    color: rgba(133, 133, 160, 0.55);
}

#pcbf-wrapper input[type="text"]:focus,
#pcbf-wrapper input[type="email"]:focus,
#pcbf-wrapper textarea:focus {
    border-color: var(--pcbf-border-focus);
    box-shadow: 0 0 0 3px rgba(124, 111, 247, 0.1);
}

/* ---------- Char count ---------- */
.pcbf-char-count {
    display: block;
    text-align: right;
    font-size: 11px;
    color: var(--pcbf-text-muted);
    margin-top: 5px;
    opacity: 0.7;
}

/* ---------- Two-column row ---------- */
.pcbf-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 10px;
    padding: 0 18px;
}

.pcbf-row .pcbf-section {
    padding-left: 0;
    padding-right: 0;
}

/* ---------- Error ---------- */
.pcbf-error {
    margin: 0 18px 8px;
    padding: 9px 12px;
    background: rgba(226, 75, 74, 0.1);
    border: 1px solid rgba(226, 75, 74, 0.3);
    border-radius: var(--pcbf-radius-sm);
    color: #f0908f;
    font-size: 12.5px;
}

/* ---------- Submit Button ---------- */
.pcbf-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 36px);
    margin: 10px 18px 8px;
    padding: 11px 20px;
    background: var(--pcbf-accent);
    color: #fff;
    border: none;
    border-radius: var(--pcbf-radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 3px 16px rgba(124, 111, 247, 0.4);
    letter-spacing: 0.2px;
}

.pcbf-submit-btn:hover:not(:disabled) {
    background: var(--pcbf-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 5px 22px rgba(124, 111, 247, 0.55);
}

.pcbf-submit-btn:active {
    transform: translateY(0);
}

.pcbf-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---------- Privacy note ---------- */
.pcbf-privacy {
    text-align: center;
    font-size: 11px;
    color: var(--pcbf-text-muted);
    margin: 4px 0 16px;
    opacity: 0.65;
    padding: 0 18px;
}

/* ---------- Success state ---------- */
#pcbf-success {
    padding: 32px 24px 28px;
    text-align: center;
}

.pcbf-success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    background: var(--pcbf-accent-dim);
    border: 1px solid rgba(124, 111, 247, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pcbf-accent);
}

.pcbf-success-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--pcbf-text);
    margin: 0 0 10px;
}

.pcbf-success-msg {
    font-size: 13px;
    color: var(--pcbf-text-muted);
    line-height: 1.65;
    margin: 0 0 22px;
}

.pcbf-reset-btn {
    background: var(--pcbf-accent-dim);
    border: 1px solid rgba(124, 111, 247, 0.35);
    border-radius: 50px;
    color: var(--pcbf-accent);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 22px;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s;
}

.pcbf-reset-btn:hover {
    background: rgba(124, 111, 247, 0.2);
    border-color: rgba(124, 111, 247, 0.5);
}

/* ---------- Divider ---------- */
.pcbf-divider {
    height: 1px;
    background: var(--pcbf-border);
    margin: 4px 18px;
}

/* ---------- Animations ---------- */
@keyframes pcbf-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.55; transform: scale(0.8); }
}

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

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
    #pcbf-wrapper {
        bottom: 16px;
        left: 16px;
    }

    #pcbf-panel {
        width: calc(100vw - 32px);
        left: 0;
    }

    .pcbf-row {
        grid-template-columns: 1fr;
    }
}
