/**
 * Feedback Widget CSS
 * Slide-out panel design with smooth animations
 */

/* Widget Container */
.feedback-widget {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 9999;
    font-family: 'Open Sans', sans-serif;
}

/* Feedback Button - Always visible, attached to panel */
.feedback-button {
    position: fixed;
    bottom: 20%;
    right: 0;
    transform: rotate(-90deg);
    background: #28D792;
    color: white;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: -2px 0 10px rgba(40, 215, 146, 0.3);
    transition: all 0.3s ease;
    z-index: 10001;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-button:hover {
    background: #0B624D;
    transform: rotate(-90deg) translateX(-3px);
    box-shadow: -3px 0 15px rgba(40, 215, 146, 0.4);
}

.feedback-button-text {
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

/* Widget Open State */
.feedback-widget-open .feedback-button {
    right: 500px; /* Panel width */
    bottom: 20%; /* Align with button position */
    transform: rotate(-90deg) translateX(0px);
    border-radius: 8px;
}

/* Backdrop */
.feedback-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
}

.feedback-widget-open .feedback-backdrop {
    opacity: 1;
    visibility: visible;
}

/* Panel */
.feedback-panel {
    position: fixed;
    bottom: 10%;
    right: -500px; /* Hidden by default */
    width: 500px;
    height: 60%;
    background: white;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.feedback-widget-open .feedback-panel {
    right: 0;
}


/* Content Area */
.feedback-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0 20px 0;
    box-sizing: border-box;
}

/* Feedback Header */
.feedback-header .feedback-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    text-align: center;
    border: none;
    padding: 0;
    flex: 1;
}

/* Form Container */
.feedback-form-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Feedback Header */
.feedback-header {
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid #E5E7EB;
    padding: 20px;
    margin: 0;
    position: relative;
}

/* Back Button */
.feedback-back {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.feedback-back:hover {
    color: #374151;
    background: #F3F4F6;
}

.feedback-back i {
    margin-right: 8px;
}

/* Close Form Button */
.feedback-close-form {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
}

.feedback-close-form:hover {
    color: #374151;
    background: #F3F4F6;
}

/* Form Styles */
.feedback-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 20px;
}

.form-group {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #28D792;
    box-shadow: 0 0 0 3px rgba(40, 215, 146, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* File Upload */
.file-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
}

.file-upload-area:hover,
.file-upload-area.drag-over {
    border-color: #3b82f6;
    background: #f8faff;
}

.file-upload-content i {
    font-size: 32px;
    color: #9ca3af;
    margin-bottom: 8px;
    display: block;
}

.file-upload-content p {
    color: #374151;
    margin: 0 0 4px 0;
    font-weight: 500;
}

.file-upload-content small {
    color: #6b7280;
    font-size: 12px;
}

/* File Preview */
.file-preview {
    margin-top: 16px;
}

.file-preview-item {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 12px;
    gap: 12px;
}

.file-preview-item img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
}

.file-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-name {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.remove-file {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.remove-file:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Submit Button */
.feedback-submit {
    background: #FFED37;
    color: #1F1F1F;
    border: none;
    padding: 12px 32px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.feedback-submit:hover:not(:disabled) {
    background: #F5E000;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

.submit-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Success/Error Messages */
.feedback-success,
.feedback-error {
    text-align: center;
    padding: 40px 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.success-icon,
.error-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.success-icon i {
    color: var(--brand-green-bright);
}

.error-icon i {
    color: var(--brand-green-bright);
}

.feedback-button-text i {
    margin-right: 8px;
    font-size: 11px;
}

.feedback-success h2,
.feedback-error h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 12px 0;
}

.feedback-success h2 {
    color: var(--brand-green-bright);
}

.feedback-error h2 {
    color: var(--brand-green-bright);
}

.feedback-success p,
.feedback-error p {
    color: #6b7280;
    margin: 0 0 32px 0;
    line-height: 1.5;
}

.feedback-button-primary {
    background: #FFED37;
    color: #1F1F1F;
    border: none;
    padding: 12px 24px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.feedback-button-primary:hover {
    background: #F5E000;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .feedback-panel {
        width: 100%;
        right: -100%;
        height: 80%;
        bottom: 10%;
    }
    
    .feedback-widget-open .feedback-panel {
        right: 0;
    }
    
    .feedback-widget-open .feedback-button {
        right: 0;
        bottom: 20px;
        transform: none;
        position: absolute;
        padding: 12px 16px;
        border-radius: 6px;
        background: rgba(40, 215, 146, 0.9);
    }
    
    .feedback-content {
        padding: 80px 20px 20px;
    }
    
    .feedback-close {
        top: 24px;
        right: 70px; /* Make room for the feedback button */
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .feedback-button {
        border: 2px solid white;
    }
    
    .feedback-option {
        border-width: 3px;
    }
    
    .form-group input,
    .form-group textarea {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .feedback-panel,
    .feedback-backdrop,
    .feedback-button,
    .feedback-option,
    .feedback-submit {
        transition: none;
    }
}

/* Focus visible for keyboard navigation */
@media (hover: none) {
    .feedback-option:hover {
        transform: none;
        box-shadow: none;
    }
}