/* Feedback Widget - Slide-up panel in bottom-right corner */
/* Uses app theme colors: primary #1d76b0, success #3bb0c4, navbar #2c3e50 */

#feedback-widget {
    position: fixed;
    bottom: 0;
    right: 24px;
    z-index: 1050;
    font-family: 'Open Sans', sans-serif;
}

/* Tab trigger - sticks out from bottom */
#feedback-widget .feedback-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #2c3e50;
    color: #fff;
    border: none;
    border-radius: 6px 6px 0 0;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
}

#feedback-widget .feedback-tab:hover {
    background: #1d76b0;
}

#feedback-widget .feedback-tab i {
    font-size: 14px;
}

#feedback-widget .feedback-tab.active {
    background: #1d76b0;
}

/* Panel container - anchored to bottom, covers the tab when open */
#feedback-widget .feedback-panel {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 320px;
    background: #fff;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
    overflow: hidden;
}

#feedback-widget .feedback-panel.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Panel header */
#feedback-widget .feedback-header {
    background: linear-gradient(135deg, #2c3e50 0%, #1d76b0 100%);
    color: #fff !important;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#feedback-widget .feedback-header h4,
#feedback-widget .feedback-header h4 i {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #fff !important;
}

#feedback-widget .feedback-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

#feedback-widget .feedback-close:hover {
    color: #fff;
}

/* Panel body */
#feedback-widget .feedback-body {
    padding: 16px;
    max-height: 380px;
    overflow-y: auto;
}

/* Type selector - pill buttons */
#feedback-widget .feedback-types {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

#feedback-widget .feedback-type-btn {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    background: #fff;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

#feedback-widget .feedback-type-btn:hover {
    border-color: #1d76b0;
    color: #1d76b0;
}

#feedback-widget .feedback-type-btn.active {
    background: #1d76b0;
    border-color: #1d76b0;
    color: #fff;
}

#feedback-widget .feedback-type-btn.active[data-type="bug"] {
    background: #c9444d;
    border-color: #c9444d;
}

#feedback-widget .feedback-type-btn.active[data-type="feature"] {
    background: #3bb0c4;
    border-color: #3bb0c4;
}

#feedback-widget .feedback-type-btn.active[data-type="other"] {
    background: #7f8c8d;
    border-color: #7f8c8d;
}

/* Form fields */
#feedback-widget .feedback-field {
    margin-bottom: 12px;
}

#feedback-widget .feedback-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

#feedback-widget .feedback-field label .required {
    color: #e74c3c;
}

#feedback-widget .feedback-field input,
#feedback-widget .feedback-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Open Sans', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

#feedback-widget .feedback-field input:focus,
#feedback-widget .feedback-field textarea:focus {
    outline: none;
    border-color: #1d76b0;
    box-shadow: 0 0 0 3px rgba(29, 118, 176, 0.1);
}

#feedback-widget .feedback-field textarea {
    resize: vertical;
    min-height: 80px;
    max-height: 150px;
}

#feedback-widget .feedback-hint {
    font-size: 11px;
    color: #999;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Error message */
#feedback-widget .feedback-error {
    background: #fdf2f2;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 12px;
    display: none;
}

/* Panel footer */
#feedback-widget .feedback-footer {
    padding: 12px 16px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

#feedback-widget .feedback-footer .btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0;
}

#feedback-widget .btn-cancel {
    background: #fff;
    border: 1px solid #ddd;
    color: #666;
}

#feedback-widget .btn-cancel:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

#feedback-widget .btn-submit {
    background: #1d76b0;
    border: 1px solid #054e7d;
    color: #fff;
}

#feedback-widget .btn-submit:hover {
    background: #166090;
}

#feedback-widget .btn-submit:disabled {
    background: #a0c4de;
    border-color: #a0c4de;
    cursor: not-allowed;
}

#feedback-widget .btn-submit .spinner {
    display: none;
}

#feedback-widget .btn-submit.loading .spinner {
    display: inline-block;
}

#feedback-widget .btn-submit.loading .btn-text {
    display: none;
}

/* Toast notification */
#feedback-toast {
    position: fixed;
    bottom: 80px;
    right: 24px;
    z-index: 1060;
    background: #2c3e50;
    color: #fff;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: toastSlideUp 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

#feedback-toast.success {
    background: #27ae60;
}

#feedback-toast.error {
    background: #e74c3c;
}

#feedback-toast i {
    font-size: 16px;
}

@keyframes toastSlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    #feedback-widget {
        right: 12px;
    }

    #feedback-widget .feedback-panel {
        width: calc(100vw - 24px);
        max-width: 320px;
    }
}
