/**
 * Pusedainos Wiki - Feedback Widget Styles
 * 
 * Styles for the feedback banner, button, modal, and element selector.
 */

/* ===== Feedback Banner ===== */
.feedback-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #8b0000 0%, #a00000 100%);
    color: white;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.feedback-banner.hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.feedback-banner-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.feedback-banner-icon {
    font-size: 1.2rem;
}

.feedback-banner-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    padding: 0 0.5rem;
    transition: opacity 0.2s;
}

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

/* Adjust page content when banner is visible */
body:has(.feedback-banner:not(.hidden)) {
    padding-top: 45px;
}

/* ===== Feedback Toggle Button ===== */
.feedback-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9998;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #8b0000 0%, #a00000 100%);
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feedback-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(139, 0, 0, 0.5);
}

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

.feedback-toggle svg {
    width: 24px;
    height: 24px;
}

/* ===== Feedback Modal ===== */
.feedback-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.feedback-modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.feedback-modal.open .feedback-modal-content {
    transform: scale(1);
}

.feedback-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
}

.feedback-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #1a1a1a;
}

.feedback-modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: #666;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.feedback-modal-close:hover {
    color: #8b0000;
}

.feedback-modal-body {
    padding: 1.5rem;
}

/* ===== Feedback Steps ===== */
.feedback-step {
    display: none;
}

.feedback-step.active {
    display: block;
}

.feedback-step-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

/* Type Selection Grid */
.feedback-type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.feedback-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: #f8f8f8;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feedback-type-btn:hover {
    background: #f0f0f0;
    border-color: #ddd;
}

.feedback-type-btn.selected {
    background: #fff5f5;
    border-color: #8b0000;
}

.feedback-type-btn .type-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.feedback-type-btn .type-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.feedback-type-btn .type-desc {
    font-size: 0.75rem;
    color: #666;
}

/* Actions */
.feedback-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.feedback-actions .btn {
    flex: 1;
    justify-content: center;
}

/* Element Preview */
.feedback-element-preview,
.feedback-screenshot-preview {
    background: #f8f8f8;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.feedback-element-preview.hidden,
.feedback-screenshot-preview.hidden {
    display: none;
}

.feedback-element-preview p,
.feedback-screenshot-preview p {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    color: #666;
}

.feedback-element-preview code,
#feedback-element-selector {
    display: block;
    background: #1a1a1a !important;
    color: #f0f0f0 !important;
    padding: 0.75rem !important;
    border-radius: 4px;
    font-size: 0.8rem !important;
    font-family: 'Courier New', Courier, monospace !important;
    word-break: break-all;
    margin-bottom: 0.5rem;
    min-height: 1.5em;
    white-space: pre-wrap;
}

.feedback-screenshot-preview img {
    max-width: 100%;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

/* Step Navigation */
.feedback-step-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Form Styles */
.feedback-step .form-group {
    margin-bottom: 1rem;
}

.feedback-step .form-group label {
    display: block;
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.feedback-step textarea,
.feedback-step input[type="text"],
.feedback-step input[type="email"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.feedback-step textarea:focus,
.feedback-step input:focus {
    outline: none;
    border-color: #8b0000;
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Success/Error States */
.feedback-success,
.feedback-error {
    text-align: center;
    padding: 2rem 1rem;
}

.success-icon {
    width: 64px;
    height: 64px;
    background: #22c55e;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem;
}

.error-icon {
    width: 64px;
    height: 64px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem;
}

.feedback-success h4,
.feedback-error h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
}

.feedback-success p,
.feedback-error p {
    color: #666;
    margin-bottom: 1.5rem;
}

/* ===== Element Selector Overlay ===== */
.feedback-selector-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9997;
    pointer-events: none;
}

.feedback-selector-overlay.hidden {
    display: none;
}

.selector-instructions {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    pointer-events: none;
}

/* Highlight class for element selection */
.feedback-highlight {
    outline: 3px solid #8b0000 !important;
    outline-offset: 2px;
    background-color: rgba(139, 0, 0, 0.1) !important;
}

/* ===== Buttons ===== */
.feedback-step .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feedback-step .btn-primary {
    background: linear-gradient(135deg, #8b0000 0%, #a00000 100%);
    color: white;
}

.feedback-step .btn-primary:hover {
    background: linear-gradient(135deg, #7a0000 0%, #900000 100%);
}

.feedback-step .btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.feedback-step .btn-secondary:hover {
    background: #e0e0e0;
}

.feedback-step .btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .feedback-banner {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .feedback-banner-text {
        display: none;
    }
    
    .feedback-banner-content::after {
        content: 'Click the 💬 button to give feedback';
    }
    
    .feedback-toggle {
        bottom: 1rem;
        right: 1rem;
        width: 48px;
        height: 48px;
    }
    
    .feedback-modal-content {
        max-height: 100vh;
        border-radius: 0;
    }
    
    .feedback-type-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .feedback-actions {
        flex-direction: column;
    }
}
