/**
 * עיצוב כפתור דיווח על בעיה - סגנון המכלול
 * TTFC Issue Reporter
 */

/* =====================================
   כפתור הדיווח הצף
   ===================================== */
.issue-report-trigger {
    position: fixed;
    right: 0;
    bottom: 10px;
    z-index: 99999;
    
    display: flex;
    align-items: center;
    gap: 0.5rem;
    
    background-color: var(--secondary-color-daat-bright);
    color: #555;
    border: none;
    border-radius: 5px 0 0 5px;
    padding: 0.75rem 1rem;
    
    cursor: pointer;
    font-family: var(--font-family-accent, inherit);
    font-size: 0.9rem;
    font-weight: 500;
    
    box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    
    writing-mode: horizontal-tb;
}

.issue-report-trigger:hover {
    background-color: var(--secondary-color-daat-bright);
    padding-right: 1.25rem;
    box-shadow: -4px 4px 15px rgba(0, 0, 0, 0.15);
}

.issue-report-trigger:focus-visible {
    outline: 2px solid var(--primary-color-daat);
    outline-offset: 2px;
}

.issue-report-trigger svg {
    flex-shrink: 0;
}

.issue-report-trigger-text {
    white-space: nowrap;
}

/* מצב מכווץ במובייל */
@media screen and (max-width: 768px) {
    .issue-report-trigger {
        padding: 0.6rem 0.75rem;
        font-size: 0;
        gap: 0;
    }
    
    .issue-report-trigger-text {
        display: none;
    }
    
    .issue-report-trigger:hover {
        padding-right: 0.75rem;
    }
}

/* =====================================
   שכבת רקע כהה
   ===================================== */
.issue-report-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.issue-report-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* =====================================
   חלון המודאל
   ===================================== */
.issue-report-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 10000;
    
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    
    background-color: var(--white, #ffffff);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    
    overflow: hidden;
}

.issue-report-modal.active {
    opacity: 1;
    visibility: visible;
    z-index: 100000;
    transform: translate(-50%, -50%) scale(1);
}

.issue-report-modal-content {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

/* כותרת המודאל */
.issue-report-modal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background-color: var(--primary-color-daat);
    color: #ffffff !important;
    position: relative;
}

.issue-report-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    font-family: var(--font-family-accent, inherit);
    color: #ffffff !important;
    text-align: center;
}

/* כפתור סגירה */
.issue-report-close {
    background: none;
    border: none;
    color: var(--white, #ffffff);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.issue-report-close:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.issue-report-close:focus-visible {
    outline: 2px solid var(--white, #ffffff);
    outline-offset: 2px;
}

/* גוף המודאל */
.issue-report-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

/* =====================================
   הטופס
   ===================================== */
.issue-report-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* תצוגת העמוד הנוכחי */
.issue-report-current-page {
    background-color: var(--gray-light, #f5f5f5);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.issue-report-current-page .issue-report-label {
    color: #555;
}

.issue-report-page-name {
    color: var(--primary-color, #1a1a2e);
    font-weight: 500;
    word-break: break-word;
}

/* שדות הטופס */
.issue-report-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.issue-report-field label {
    font-weight: 500;
    color: var(--primary-color, #333333);
    font-size: 0.95rem;
    font-family: var(--font-family-accent, inherit);
}

.issue-report-field .required {
    color: var(--alert-red, #b22222);
}

.issue-report-field .optional {
    color: #555;
    font-weight: normal;
    font-size: 0.85rem;
}

.issue-report-field textarea,
.issue-report-field input {
    width: 100%;
    padding: 0.85rem;
    border: 1px solid var(--gray-mild, #e0e0e0);
    border-radius: 6px;
    font-size: 1rem;
    font-family: var(--font-family-accent, inherit);
    color: var(--text-color, #333333);
    background-color: var(--white, #ffffff);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    resize: vertical;
}

.issue-report-field textarea {
    min-height: 120px;
}

.issue-report-field textarea:focus,
.issue-report-field input:focus {
    outline: none;
    border-color: var(--primary-color, #1a1a2e);
    box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.1);
}

.issue-report-field textarea[aria-invalid="true"],
.issue-report-field input[aria-invalid="true"] {
    border-color: var(--alert-red, #b22222);
    box-shadow: 0 0 0 3px rgba(178, 34, 34, 0.1);
}

/* טקסט עזרה */
.issue-report-help {
    font-size: 0.85rem;
    color: #555;
}

.issue-report-error {
    font-size: 0.85rem;
    color: var(--alert-red, #b22222);
    min-height: 1.2rem;
}

/* =====================================
   כפתור שליחה
   ===================================== */
.issue-report-actions {
    margin-top: 0.5rem;
}

.issue-report-submit {
    width: 100%;
    padding: 0.9rem 1.5rem;
    background-color: var(--primary-color-daat);
    color: var(--white, #ffffff);
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-family-accent, inherit);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.issue-report-submit:hover {
    background-color: var(--primary-color-daat);
}

.issue-report-submit:active {
    transform: scale(0.98);
}

.issue-report-submit:focus-visible {
    outline: 2px solid var(--primary-color, #1a1a2e);
    outline-offset: 2px;
}

.issue-report-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* מצב טעינה */
.issue-submit-loading {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.issue-report-submit.loading .issue-submit-text {
    display: none;
}

.issue-report-submit.loading .issue-submit-loading {
    display: flex;
}

/* אנימציית ספינר */
.issue-spinner {
    animation: issue-spin 1s linear infinite;
}

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

/* =====================================
   הודעת הצלחה
   ===================================== */
.issue-report-success {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem;
    gap: 1rem;
}

.issue-report-success.active {
    display: flex;
}

.issue-report-success svg {
    color: #10b981;
}

.issue-report-success h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--primary-color, #1a1a2e);
}

.issue-report-success p {
    margin: 0;
    color: #555;
}

.issue-report-close-success {
    margin-top: 0.5rem;
    padding: 0.6rem 1.5rem;
    background-color: var(--gray-light, #f5f5f5);
    color: var(--primary-color, #333333);
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: var(--font-family-accent, inherit);
    cursor: pointer;
    transition: background-color 0.2s;
}

.issue-report-close-success:hover {
    background-color: var(--gray-mild, #e0e0e0);
}

/* =====================================
   נגישות
   ===================================== */
@media (prefers-reduced-motion: reduce) {
    .issue-report-trigger,
    .issue-report-modal,
    .issue-report-overlay,
    .issue-report-submit,
    .issue-spinner {
        transition: none;
        animation: none;
    }
}

/* ניגודיות גבוהה */
@media (prefers-contrast: high) {
    .issue-report-trigger {
        border: 2px solid var(--white, #ffffff);
    }
    
    .issue-report-modal {
        border: 2px solid var(--primary-color, #1a1a2e);
    }
    
    .issue-report-field textarea,
    .issue-report-field input {
        border-width: 2px;
    }
}

/* =====================================
   התאמות RTL
   ===================================== */
[dir="rtl"] .issue-report-trigger,
.rtl .issue-report-trigger {
    right: 0;
    left: auto;
    border-radius: 8px 0 0 8px;
}

[dir="rtl"] .issue-report-trigger:hover,
.rtl .issue-report-trigger:hover {
    padding-right: 1.25rem;
    padding-left: 1rem;
}

/* =====================================
   התאמות מובייל
   ===================================== */
@media screen and (max-width: 480px) {
    .issue-report-modal {
        width: 95%;
        max-height: 85vh;
    }
    
    .issue-report-modal-header {
        padding: 1rem 1.25rem;
    }
    
    .issue-report-modal-body {
        padding: 1.25rem;
    }
    
    .issue-report-field textarea {
        min-height: 100px;
    }
}

