/* ==========================================================================
   Peak Feedback Widget — Front-end Styles
   ========================================================================== */

:root {
    --pf-dark: #0d0d0d;
    --pf-dark-secondary: #1a1a1a;
    --pf-accent: #05F88B;
    --pf-accent-hover: #04d978;
    --pf-accent-light: rgba(5, 248, 139, 0.1);
    --pf-text: #ffffff;
    --pf-text-muted: #9ca3af;
    --pf-border: #2a2a2a;
    --pf-input-bg: #111111;
    --pf-radius: 12px;
    --pf-radius-sm: 8px;
    --pf-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    --pf-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* -- Trigger Button -- */
#pf-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999998;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--pf-accent);
    color: #0d0d0d;
    border: none;
    border-radius: 50px;
    font-family: var(--pf-font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    letter-spacing: 0.01em;
}

#pf-trigger:hover {
    background: var(--pf-accent-hover);
}

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

#pf-trigger svg {
    flex-shrink: 0;
}

/* -- Modal Overlay -- */
#pf-modal {
    position: fixed;
    bottom: 90px;
    right: 24px;
    z-index: 999999;
    width: 400px;
    max-height: calc(100vh - 120px);
    animation: pfSlideUp 0.3s ease;
}

#pf-modal.pf-hidden {
    display: none;
}

@keyframes pfSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* -- Modal Inner -- */
.pf-modal-inner {
    background: var(--pf-dark);
    border: 1px solid var(--pf-border);
    border-radius: var(--pf-radius);
    box-shadow: var(--pf-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 120px);
}

/* -- Header -- */
.pf-header {
    padding: 24px 24px 16px;
    background: linear-gradient(135deg, var(--pf-dark-secondary), var(--pf-dark));
    border-bottom: 1px solid var(--pf-border);
}

.pf-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.pf-logo {
    font-family: var(--pf-font);
    font-size: 13px;
    font-weight: 700;
    color: var(--pf-accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

#pf-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--pf-border);
    border-radius: 8px;
    color: var(--pf-text-muted);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

#pf-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.pf-title {
    font-family: var(--pf-font);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--pf-text);
    margin: 0;
}

/* -- Tabs -- */
.pf-tabs {
    display: flex;
    border-bottom: 1px solid var(--pf-border);
    background: var(--pf-dark-secondary);
}

.pf-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--pf-text-muted);
    font-family: var(--pf-font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.pf-tab:hover {
    color: var(--pf-text);
    background: rgba(255, 255, 255, 0.03);
}

.pf-tab--active {
    color: var(--pf-accent);
    border-bottom-color: var(--pf-accent);
}

/* -- Body / Form -- */
.pf-body {
    padding: 20px 24px 24px;
    overflow-y: auto;
}

/* -- Item Tabs Bar -- */
.pf-item-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 14px;
}

#pf-item-tab-bar {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.pf-item-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--pf-input-bg);
    border: 1px solid var(--pf-border);
    border-radius: 6px;
    color: var(--pf-text-muted);
    font-family: var(--pf-font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 32px;
    justify-content: center;
}

.pf-item-tab:hover {
    border-color: #444;
    color: var(--pf-text);
}

.pf-item-tab--active {
    background: var(--pf-accent-light);
    border-color: var(--pf-accent);
    color: var(--pf-accent);
}

.pf-item-tab-close {
    font-size: 14px;
    line-height: 1;
    margin-left: 2px;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.pf-item-tab:hover .pf-item-tab-close {
    opacity: 1;
}

.pf-item-tab-close:hover {
    color: #dc2626;
}

.pf-item-tab-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: 1px dashed var(--pf-border);
    border-radius: 6px;
    color: var(--pf-text-muted);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.pf-item-tab-add:hover {
    border-color: var(--pf-accent);
    color: var(--pf-accent);
    background: var(--pf-accent-light);
}

/* -- Item Panel -- */
.pf-item {
    animation: pfFadeIn 0.2s ease;
}

@keyframes pfFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* -- Type Selector -- */
.pf-type-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.pf-type {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    background: var(--pf-input-bg);
    border: 1px solid var(--pf-border);
    border-radius: var(--pf-radius-sm);
    color: var(--pf-text-muted);
    font-family: var(--pf-font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.pf-type:hover {
    border-color: #444;
    color: var(--pf-text);
}

.pf-type--active {
    background: var(--pf-accent-light);
    border-color: var(--pf-accent);
    color: var(--pf-accent);
}

.pf-type input[type="radio"] {
    display: none;
}

/* -- Form Fields -- */
.pf-field {
    margin-bottom: 12px;
}

.pf-field input,
.pf-field textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--pf-input-bg);
    border: 1px solid var(--pf-border);
    border-radius: var(--pf-radius-sm);
    color: var(--pf-text);
    font-family: var(--pf-font);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    outline: none;
    resize: vertical;
}

.pf-field input::placeholder,
.pf-field textarea::placeholder {
    color: #555;
}

.pf-field input:focus,
.pf-field textarea:focus {
    border-color: var(--pf-accent);
    box-shadow: 0 0 0 3px rgba(5, 248, 139, 0.15);
}

/* -- Attachment -- */
.pf-attachment {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.pf-attach-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--pf-input-bg);
    border: 1px solid var(--pf-border);
    border-radius: var(--pf-radius-sm);
    color: var(--pf-text-muted);
    font-family: var(--pf-font);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.pf-attach-btn:hover {
    border-color: #444;
    color: var(--pf-text);
}

.pf-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.pf-file-name {
    font-size: 12px;
    color: var(--pf-text-muted);
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* -- Submit -- */
.pf-submit {
    width: 100%;
    padding: 14px;
    background: var(--pf-accent);
    color: #0d0d0d;
    border: none;
    border-radius: var(--pf-radius-sm);
    font-family: var(--pf-font);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    letter-spacing: 0.01em;
}

.pf-submit:hover {
    background: var(--pf-accent-hover);
}

.pf-submit-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pf-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(13, 13, 13, 0.3);
    border-top-color: #0d0d0d;
    border-radius: 50%;
    animation: pfSpin 0.6s linear infinite;
}

@keyframes pfSpin {
    to { transform: rotate(360deg); }
}

.pf-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* -- Success -- */
.pf-success {
    text-align: center;
    padding: 32px 0;
    color: var(--pf-text);
}

.pf-success svg {
    color: #22c55e;
    margin-bottom: 16px;
}

.pf-success p {
    font-family: var(--pf-font);
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px;
}

.pf-link {
    display: inline-block;
    background: none;
    border: none;
    color: var(--pf-accent);
    font-family: var(--pf-font);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.pf-link:hover {
    color: var(--pf-accent-hover);
}

/* -- Panel placeholder -- */
.pf-panel-placeholder {
    text-align: center;
    padding: 40px 0;
    color: var(--pf-text-muted);
}

.pf-panel-placeholder svg {
    margin-bottom: 12px;
    opacity: 0.4;
}

.pf-panel-placeholder p {
    font-family: var(--pf-font);
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
}

/* -- Utility -- */
.pf-hidden {
    display: none !important;
}

/* -- Responsive -- */
@media (max-width: 480px) {
    #pf-modal {
        right: 12px;
        left: 12px;
        bottom: 80px;
        width: auto;
    }

    #pf-trigger {
        right: 16px;
        bottom: 16px;
    }

    #pf-trigger span {
        display: none;
    }

    #pf-trigger {
        padding: 14px;
        border-radius: 50%;
    }
}
