/**
 * Feedback Modal Styles for Mandala Studio
 * Glassmorphism design matching the demo tour aesthetics.
 * Includes diagnostic preview section.
 * 
 * Copyright (c) 2024-2026 Jolly Grid. All Rights Reserved.
 */

/* ===== MODAL CONTAINER ===== */
.feedback-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.feedback-modal.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

/* ===== OVERLAY ===== */
.feedback-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ===== MODAL CONTENT ===== */
.feedback-content {
    position: relative;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    background: var(--bg-card, rgba(30, 30, 40, 0.95));
    border-radius: 16px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: feedbackSlideIn 0.3s ease-out;
}

@keyframes feedbackSlideIn {
    from {
        transform: translateY(-20px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* ===== HEADER ===== */
.feedback-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--gradient-primary, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.feedback-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.feedback-header h2 i {
    font-size: 20px;
}

.feedback-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.feedback-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

/* ===== BODY ===== */
.feedback-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
}

/* ===== FORM ===== */
.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ===== FEEDBACK TYPE SELECTOR ===== */
.feedback-type-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.feedback-type-option {
    cursor: pointer;
}

.feedback-type-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.feedback-type-option .type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--bg-tertiary, rgba(255, 255, 255, 0.05));
    border: 2px solid transparent;
    border-radius: 12px;
    transition: all 0.2s ease;
    text-align: center;
}

.feedback-type-option .type-card i {
    font-size: 24px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.6));
    transition: color 0.2s ease;
}

.feedback-type-option .type-card span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    transition: color 0.2s ease;
}

.feedback-type-option input:checked + .type-card {
    border-color: var(--accent-purple, #667eea);
    background: rgba(102, 126, 234, 0.15);
}

.feedback-type-option input:checked + .type-card i,
.feedback-type-option input:checked + .type-card span {
    color: var(--accent-purple, #667eea);
}

.feedback-type-option:hover .type-card {
    background: var(--bg-hover, rgba(255, 255, 255, 0.08));
}

/* Bug type - red accent */
.feedback-type-option input[value="bug"]:checked + .type-card {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

.feedback-type-option input[value="bug"]:checked + .type-card i,
.feedback-type-option input[value="bug"]:checked + .type-card span {
    color: #ef4444;
}

/* Feature type - yellow accent */
.feedback-type-option input[value="feature"]:checked + .type-card {
    border-color: #eab308;
    background: rgba(234, 179, 8, 0.15);
}

.feedback-type-option input[value="feature"]:checked + .type-card i,
.feedback-type-option input[value="feature"]:checked + .type-card span {
    color: #eab308;
}

/* ===== FORM FIELDS ===== */
.feedback-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feedback-field label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #fff);
    display: flex;
    align-items: center;
    gap: 8px;
}

.feedback-field label i {
    color: var(--accent-purple, #667eea);
}

.feedback-field label .required {
    color: #ef4444;
}

.feedback-field textarea,
.feedback-field input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-tertiary, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
    border-radius: 10px;
    color: var(--text-primary, #fff);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    resize: vertical;
    box-sizing: border-box;
}

.feedback-field textarea:focus,
.feedback-field input:focus {
    outline: none;
    border-color: var(--accent-purple, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.feedback-field textarea::placeholder,
.feedback-field input::placeholder {
    color: var(--text-muted, rgba(255, 255, 255, 0.4));
}

.feedback-field textarea {
    min-height: 100px;
}

.char-count {
    font-size: 12px;
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
    text-align: right;
}

.char-count .over-limit {
    color: #ef4444;
    font-weight: 600;
}

.field-hint {
    font-size: 12px;
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
    margin-top: -4px;
}

/* ===== DIAGNOSTIC SECTION ===== */
.feedback-diagnostic-section {
    margin-top: 4px;
}

.diagnostic-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.diagnostic-toggle:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.06));
    color: var(--text-primary, #fff);
}

.diagnostic-toggle i {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.diagnostic-preview {
    margin-top: 8px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    overflow: hidden;
}

.diagnostic-preview.hidden {
    display: none;
}

.diagnostic-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(59, 130, 246, 0.1);
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    font-size: 12px;
    color: #60a5fa;
}

.diagnostic-notice i {
    flex-shrink: 0;
}

.diagnostic-content {
    padding: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.diagnostic-group {
    margin-bottom: 12px;
}

.diagnostic-group:last-child {
    margin-bottom: 0;
}

.diagnostic-group-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-purple, #667eea);
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.diagnostic-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 12px;
}

.diagnostic-label {
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
}

.diagnostic-value {
    color: var(--text-primary, #fff);
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 11px;
}

/* ===== ACTIONS ===== */
.feedback-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
}

.feedback-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feedback-btn.primary {
    background: var(--gradient-primary, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    color: #fff;
}

.feedback-btn.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.feedback-btn.primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.feedback-btn.secondary {
    background: var(--bg-tertiary, rgba(255, 255, 255, 0.1));
    color: var(--text-secondary, rgba(255, 255, 255, 0.8));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
}

.feedback-btn.secondary:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.15));
}

/* ===== STATUS MESSAGES ===== */
.feedback-status {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.feedback-status.hidden {
    display: none;
}

.feedback-status.info {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.feedback-status.success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.feedback-status.error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== LIGHT THEME ===== */
[data-theme="light"] .feedback-content {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .feedback-type-option .type-card {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .feedback-type-option .type-card i,
[data-theme="light"] .feedback-type-option .type-card span {
    color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .feedback-type-option:hover .type-card {
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .feedback-field label {
    color: #1f2937;
}

[data-theme="light"] .feedback-field textarea,
[data-theme="light"] .feedback-field input {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.15);
    color: #1f2937;
}

[data-theme="light"] .feedback-field textarea::placeholder,
[data-theme="light"] .feedback-field input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .char-count,
[data-theme="light"] .field-hint {
    color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .diagnostic-toggle {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .diagnostic-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1f2937;
}

[data-theme="light"] .diagnostic-preview {
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .diagnostic-label {
    color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .diagnostic-value {
    color: #1f2937;
}

[data-theme="light"] .feedback-btn.secondary {
    background: rgba(0, 0, 0, 0.05);
    color: #374151;
    border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .feedback-btn.secondary:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .feedback-content {
        width: 95%;
        margin: 10px;
    }
    
    .feedback-type-selector {
        grid-template-columns: 1fr;
    }
    
    .feedback-type-option .type-card {
        flex-direction: row;
        padding: 12px 16px;
    }
    
    .feedback-type-option .type-card i {
        font-size: 20px;
    }
    
    .feedback-actions {
        flex-direction: column-reverse;
    }
    
    .feedback-btn {
        width: 100%;
    }
    
    .feedback-body {
        padding: 16px;
    }
    
    .diagnostic-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
}
