/* Feedback Widget Styles */

/* Floating Action Button */
.feedback-fab {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--color-primary);
    color: var(--color-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
}

.feedback-fab:hover {
    background: var(--color-accent-orange);
    transform: scale(1.08);
}

.feedback-fab:active {
    transform: scale(0.95);
}

.feedback-fab--hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.5);
}

/* Backdrop */
.feedback-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.feedback-backdrop--visible {
    opacity: 1;
    pointer-events: auto;
}

/* Panel */
.feedback-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    max-width: 480px;
    margin: 0 auto;
    background: var(--color-gray-900);
    border-top-left-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-xl);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
}

.feedback-panel--open {
    transform: translateY(0);
}

/* Panel Header */
.feedback-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.feedback-panel__title {
    color: var(--color-white);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin: 0;
}

.feedback-panel__close {
    background: none;
    border: none;
    color: var(--color-gray-400);
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background 0.2s ease;
}

.feedback-panel__close:hover {
    color: var(--color-white);
    background: rgba(255, 255, 255, 0.1);
}

/* Panel Body */
.feedback-panel__body {
    padding: var(--space-lg);
}

.feedback-panel__textarea {
    width: 100%;
    min-height: 150px;
    max-height: 300px;
    padding: var(--space-md);
    border: none;
    border-radius: 1rem;
    background: var(--color-bg-primary);
    color: var(--color-white);
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    line-height: 1.5;
    resize: vertical;
    outline: none;
    box-shadow:
        inset 8px 8px 16px rgba(0, 0, 0, 0.4),
        inset -8px -8px 16px rgba(255, 255, 255, 0.1);
    transition: box-shadow 0.2s ease;
    box-sizing: border-box;
}

.feedback-panel__textarea::placeholder {
    color: var(--color-gray-500);
}

.feedback-panel__textarea:focus {
    box-shadow:
        inset 6px 6px 12px rgba(0, 0, 0, 0.4),
        inset -6px -6px 12px rgba(255, 255, 255, 0.1),
        0 0 15px rgba(251, 146, 60, 0.3);
}

/* Actions Row */
.feedback-panel__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

/* Mic Button */
.feedback-panel__mic {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-gray-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.feedback-panel__mic:hover {
    color: var(--color-white);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

/* Mic Recording State - pulsing red */
.feedback-panel__mic--recording {
    color: var(--color-white);
    background: #e53e3e;
    border-color: #e53e3e;
    animation: mic-pulse 1.2s ease-in-out infinite;
}

@keyframes mic-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.5);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(229, 62, 62, 0);
    }
}

/* Submit Button */
.feedback-panel__submit {
    padding: var(--space-sm) var(--space-xl);
    height: 44px;
    border-radius: var(--radius-lg);
    border: none;
    background: var(--color-accent-orange);
    color: var(--color-white);
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.feedback-panel__submit:hover:not(:disabled) {
    background: var(--color-accent-orange-hover);
}

.feedback-panel__submit:active:not(:disabled) {
    transform: scale(0.97);
}

.feedback-panel__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Toast Notification */
.feedback-panel__toast {
    position: absolute;
    bottom: 100%;
    left: var(--space-lg);
    right: var(--space-lg);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-align: center;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    margin-bottom: var(--space-sm);
}

.feedback-panel__toast--visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.feedback-panel__toast--success {
    background: #276749;
    color: var(--color-white);
}

.feedback-panel__toast--error {
    background: #9b2c2c;
    color: var(--color-white);
}

/* Desktop adjustments */
@media (min-width: 769px) {
    .feedback-panel {
        bottom: 20px;
        left: 20px;
        right: auto;
        max-width: 600px;
        margin: 0;
        border-radius: var(--radius-xl);
    }

    .feedback-panel__textarea {
        min-height: 250px;
        max-height: 500px;
    }

    .feedback-backdrop {
        background: transparent;
        pointer-events: none;
    }

    .feedback-backdrop--visible {
        pointer-events: none;
    }
}

/* Small mobile adjustments */
@media (max-width: 480px) {
    .feedback-fab {
        bottom: 16px;
        left: 16px;
        width: 48px;
        height: 48px;
    }

    .feedback-panel__body {
        padding: var(--space-md);
    }

    .feedback-panel__textarea {
        min-height: 80px;
    }
}
