/* Enhanced Feedback System - Complete Custom CSS */

/* Reset and base styles */
* {
    box-sizing: border-box;
}

/* Floating Button Container */
.feedback-button-container {
    position: fixed;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 40;
}

.feedback-button-wrapper {
    position: relative;
}

/* Floating Button */
.feedback-floating-button {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    padding: 1rem;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    outline: none;
}

.feedback-floating-button:hover {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.feedback-floating-button:active {
    transform: scale(1.05) translateY(-1px);
}

.feedback-floating-button:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Button Icon */
.button-icon {
    width: 1.5rem;
    height: 1.5rem;
    position: relative;
    z-index: 10;
}

/* Button Background Effect */
.button-bg-effect {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.feedback-floating-button:hover .button-bg-effect {
    opacity: 0.2;
}

/* Button Pulse Animation */
.button-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #60a5fa;
    opacity: 0.75;
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% {
        transform: scale(1);
        opacity: 0.75;
    }
    70% {
        transform: scale(1.5);
        opacity: 0;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Tooltip */
.feedback-tooltip {
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 0.75rem;
    background: #1f2937;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(12px);
}

.feedback-button-wrapper:hover .feedback-tooltip {
    opacity: 1;
}

.tooltip-text {
    font-weight: 500;
}

.tooltip-arrow {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid #1f2937;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}

/* Modal Overlay */
.feedback-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    overflow-y: auto;
}

/* Modal Backdrop */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    transition: opacity 0.3s ease;
}

/* Modal Container */
.modal-container {
    display: flex;
    min-height: 100%;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* Modal */
.feedback-modal {
    position: relative;
    width: 100%;
    max-width: 32rem;
    transform: scale(1);
    overflow: hidden;
    border-radius: 1rem;
    background: white;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

/* Modal Header */
.modal-header {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    padding: 1.5rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-icon {
    flex-shrink: 0;
}

.chat-icon {
    width: 2rem;
    height: 2rem;
    color: white;
}

.header-text {
    flex: 1;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    margin: 0 0 0.25rem 0;
}

.modal-subtitle {
    font-size: 0.875rem;
    color: rgba(219, 234, 254, 1);
    margin: 0;
}

/* Close Button */
.close-button {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.2s ease;
    padding: 0.25rem;
    border-radius: 50%;
    outline: none;
}

.close-button:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.close-button:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

.close-icon {
    width: 1.5rem;
    height: 1.5rem;
}

/* Modal Body */
.modal-body {
    padding: 1.5rem;
}

/* Form */
.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Form Group */
.form-group {
    display: flex;
    flex-direction: column;
}

/* Form Label */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}

/* Textarea Container */
.textarea-container {
    position: relative;
}

/* Textarea */
.feedback-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    resize: none;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.5;
    outline: none;
}

.feedback-textarea::placeholder {
    color: #9ca3af;
}

.feedback-textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 4px 14px 0 rgba(59, 130, 246, 0.15);
}

/* Character Count Badge */
.char-count-badge {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
}

.char-count {
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-weight: 500;
}

/* Error Message */
.error-message {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #dc2626;
}

.error-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.error-text {
    font-size: 0.875rem;
}

/* General Error */
.general-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.general-error .error-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #dc2626;
}

.general-error .error-text {
    color: #b91c1c;
}

/* Page Info */
.page-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.75rem;
    padding: 1rem;
}

.page-info-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.link-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #3b82f6;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.page-details {
    flex: 1;
}

.page-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1d4ed8;
    margin: 0 0 0.25rem 0;
}

.page-url {
    font-size: 0.75rem;
    color: #2563eb;
    word-break: break-all;
    margin: 0;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
}

/* Cancel Button */
.cancel-button {
    padding: 0.625rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.cancel-button:hover {
    background: #e5e7eb;
}

.cancel-button:focus-visible {
    outline: 2px solid #6b7280;
    outline-offset: 2px;
}

/* Submit Button */
.submit-button {
    padding: 0.625rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    outline: none;
    position: relative;
    overflow: hidden;
}

.submit-button:hover {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.submit-button:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.submit-button.button-loading {
    opacity: 0.5;
    cursor: not-allowed;
}

.submit-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.loading-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.submit-icon {
    width: 1rem;
    height: 1rem;
}

.loading-spinner {
    width: 1rem;
    height: 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Success Toast */
.feedback-success-toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    z-index: 9999;
    transition: all 0.5s ease;
    transform: translateX(100%);
    opacity: 0;
    backdrop-filter: blur(12px);
}

.feedback-success-toast.toast-show {
    transform: translateX(0);
    opacity: 1;
}

.feedback-success-toast.toast-hide {
    transform: translateX(100%);
    opacity: 0;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-icon {
    flex-shrink: 0;
}

.success-icon {
    width: 1.5rem;
    height: 1.5rem;
}

.toast-text {
    flex: 1;
}

.toast-title {
    font-weight: 500;
    margin: 0 0 0.25rem 0;
}

.toast-subtitle {
    font-size: 0.875rem;
    color: rgba(167, 243, 208, 1);
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .feedback-button-container {
        right: 1rem;
        bottom: 2rem;
        top: auto;
        transform: none;
    }
    
    .feedback-floating-button {
        padding: 0.75rem;
    }
    
    .button-icon {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    .feedback-modal {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
    
    .feedback-tooltip {
        display: none;
    }
}

@media (max-width: 480px) {
    .feedback-button-container {
        right: 0.5rem;
        bottom: 1.5rem;
    }
    
    .feedback-floating-button {
        padding: 0.625rem;
    }
    
    .feedback-modal {
        margin: 0.5rem;
        border-radius: 1rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .cancel-button,
    .submit-button {
        width: 100%;
        justify-content: center;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .feedback-modal {
        background: #1f2937;
        color: white;
    }
    
    .form-label {
        color: #f3f4f6;
    }
    
    .feedback-textarea {
        background: #374151;
        border-color: #4b5563;
        color: white;
    }
    
    .feedback-textarea::placeholder {
        color: #9ca3af;
    }
    
    .page-info {
        background: #1e3a8a;
        border-color: #3b82f6;
    }
    
    .page-label {
        color: #bfdbfe;
    }
    
    .page-url {
        color: #93c5fd;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .button-pulse {
        display: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .feedback-floating-button {
        border: 2px solid currentColor;
    }
    
    .feedback-modal {
        border: 2px solid currentColor;
    }
    
    .feedback-textarea {
        border-width: 3px;
    }
} 