/* Nostr Feedback Widget Styles */

.feedback-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Floating toggle button */
.feedback-toggle {
    background: linear-gradient(135deg, #047857 0%, #10b981 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-weight: 500;
    font-size: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feedback-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.feedback-toggle.hidden {
    display: none;
}

.feedback-toggle:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.feedback-toggle:disabled:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Toggle button layout */
.feedback-toggle-text {
    display: inline;
}

/* Connection indicator dot */
.feedback-connection-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 8px;
    vertical-align: middle;
}

.feedback-connection-indicator.connecting {
    background: #fbbf24;
    animation: pulse 1s infinite;
}

.feedback-connection-indicator.connected {
    background: #34d399;
}

.feedback-connection-indicator.error,
.feedback-connection-indicator.disconnected {
    background: #f87171;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Relay count in header */
.feedback-relay-count {
    font-size: 11px;
    opacity: 0.8;
    margin-right: 4px;
}

/* Main form container */
.feedback-form {
    display: none;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    width: 340px;
    overflow: hidden;
    animation: slideUp 0.2s ease-out;
}

.feedback-form.visible {
    display: block;
}

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

/* Header */
.feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #047857 0%, #10b981 100%);
    color: white;
}

.feedback-header-title {
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.feedback-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.feedback-gear {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    opacity: 0.8;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-gear:hover {
    opacity: 1;
}

.feedback-gear svg {
    width: 18px;
    height: 18px;
}

.feedback-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.feedback-close:hover {
    opacity: 1;
}

/* Logged in indicator */
.feedback-logged-in {
    padding: 8px 20px;
    background: #ecfdf5;
    color: #047857;
    font-size: 12px;
    border-bottom: 1px solid #d1fae5;
}

/* Form body */
.feedback-body {
    padding: 20px;
}

.feedback-field {
    margin-bottom: 16px;
}

.feedback-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.feedback-field input,
.feedback-field textarea,
.feedback-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.feedback-field input:focus,
.feedback-field textarea:focus,
.feedback-field select:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.feedback-field textarea {
    resize: vertical;
    min-height: 100px;
}

.feedback-field select {
    cursor: pointer;
    background: white;
}

/* Submit button */
.feedback-submit {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #047857 0%, #10b981 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feedback-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

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

/* Status messages */
.feedback-status {
    text-align: center;
    padding: 12px;
    font-size: 14px;
    display: none;
}

.feedback-status.visible {
    display: block;
}

.feedback-status.success {
    color: #047857;
    background: #ecfdf5;
    border-radius: 8px;
    margin-top: 12px;
}

.feedback-status.error {
    color: #dc2626;
    background: #fef2f2;
    border-radius: 8px;
    margin-top: 12px;
}

/* Advanced panel */
.feedback-advanced {
    display: none;
    padding: 16px 20px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.feedback-advanced.visible {
    display: block;
}

.feedback-advanced-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.feedback-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
    cursor: pointer;
}

.feedback-checkbox input {
    width: auto;
    margin-top: 2px;
}

.feedback-checkbox-label {
    font-size: 13px;
    color: #4b5563;
}

.feedback-checkbox-hint {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

.feedback-npub {
    margin-top: 12px;
}

.feedback-npub-label {
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 4px;
}

.feedback-npub-value {
    font-size: 11px;
    font-family: monospace;
    color: #6b7280;
    word-break: break-all;
    background: #f3f4f6;
    padding: 6px 8px;
    border-radius: 4px;
}

.feedback-clear {
    margin-top: 12px;
    padding: 8px 12px;
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.feedback-clear:hover {
    border-color: #dc2626;
    color: #dc2626;
}

/* Thanks message */
.feedback-thanks {
    display: none;
    padding: 40px 20px;
    text-align: center;
}

.feedback-thanks.visible {
    display: block;
}

.feedback-thanks-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.feedback-thanks-text {
    font-size: 18px;
    font-weight: 600;
    color: #047857;
}

/* Schools page variant (blue theme) */
.feedback-widget.schools .feedback-toggle {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
}

.feedback-widget.schools .feedback-header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
}

.feedback-widget.schools .feedback-logged-in {
    background: #eff6ff;
    color: #1e40af;
    border-bottom-color: #dbeafe;
}

.feedback-widget.schools .feedback-field input:focus,
.feedback-widget.schools .feedback-field textarea:focus,
.feedback-widget.schools .feedback-field select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.feedback-widget.schools .feedback-submit {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
}

.feedback-widget.schools .feedback-submit:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.feedback-widget.schools .feedback-status.success {
    color: #1e40af;
    background: #eff6ff;
}

.feedback-widget.schools .feedback-thanks-text {
    color: #1e40af;
}
