/* Feedback Button & Modal Styles */

.feedback-btn {
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.feedback-btn:hover {
    transform: scale(1.1);
    background-color: var(--color-primary-hover);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

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

.feedback-btn:focus-visible {
    outline: 3px solid rgba(255,255,255,0.85);
    outline-offset: 2px;
}

/* Modal Overlay */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050; /* Higher than header */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: var(--space-md);
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

/* Modal Content */
.modal-content {
    background: var(--color-bg-surface);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    position: relative;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.modal.show .modal-content {
    transform: translateY(0);
}

/* Close Button */
.close-modal {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: var(--color-text-tertiary);
    background: none;
    border: none;
    padding: 0;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--color-text-main);
}

.modal h2 {
    margin-top: 0;
    margin-bottom: var(--space-sm);
    font-size: var(--font-size-xl);
    color: var(--color-text-secondary);
}

.modal-desc {
    font-size: var(--font-size-sm);
    color: var(--color-text-tertiary);
    margin-bottom: var(--space-md);
}

.modal textarea {
    resize: vertical;
    min-height: 120px;
    margin-bottom: var(--space-md);
    font-family: inherit;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .feedback-btn {
        bottom: calc(20px + env(safe-area-inset-bottom, 0px));
        right: 16px;
        width: 48px;
        height: 48px;
    }
    
    .modal-content {
        padding: var(--space-md);
        margin: var(--space-md);
    }
}

@media (prefers-reduced-motion: reduce) {
    .feedback-btn { transition: none; }
}

/* Desktop: mobile FAB hidden — replaced by #desktopSidePanel .dsp-card--feedback */
@media (min-width: 1280px) {
    .feedback-btn { display: none !important; }
}
