/* Help System Styles */

/* Help Answer Modal */
.help-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    padding: 20px;
    animation: fadeIn 0.3s ease-in;
    overflow-y: auto;
}

.help-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
    position: relative;
}

.help-modal-content.help-modal-expanded {
    max-width: 800px;
}

.help-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.help-modal-close:hover {
    background: #f0f0f0;
    color: #000;
}

.help-modal-header {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: white;
    padding: 30px;
    border-radius: 20px 20px 0 0;
}

.help-modal-header h2 {
    margin: 0 0 10px 0;
    font-size: 1.8rem;
}

.help-modal-subtitle {
    margin: 0;
    opacity: 0.95;
    font-size: 1.1rem;
}

.help-modal-body {
    padding: 30px;
}

.help-verb-info {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.help-verb-label {
    font-size: 0.9rem;
    color: #856404;
    margin-bottom: 5px;
}

.help-verb-word {
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.help-verb-translation {
    font-size: 1.1rem;
    color: #666;
    font-style: italic;
}

.help-tips {
    background: #e7f3ff;
    border-left: 4px solid #0d6efd;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.help-tips strong {
    color: #0d6efd;
}

.help-tips ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.help-tips li {
    margin-bottom: 5px;
    color: #333;
}

.help-modal-footer {
    padding: 20px 30px 30px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Help Request Notification (Popup) */
.help-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    z-index: 9999;
    border-left: 5px solid #ffc107;
}

.help-notification-content {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
}

.help-notification-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.help-notification-body {
    flex: 1;
}

.help-notification-title {
    font-weight: bold;
    color: #856404;
    margin-bottom: 5px;
    font-size: 1rem;
}

.help-notification-text {
    font-size: 0.9rem;
    color: #333;
}

.help-notification-btn {
    background: #ffc107;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.help-notification-btn:hover {
    background: #e0a800;
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.animate-slide-in {
    animation: slideIn 0.4s ease-out;
}

.animate-fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

/* Pulse highlight for help panel */
@keyframes pulseHighlight {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(255, 193, 7, 0);
    }
}

.pulse-highlight {
    animation: pulseHighlight 1s ease-out 3;
}

/* Improved help panel */
.help-panel {
    position: relative;
}

.help-panel .card {
    border: 2px solid #ffc107;
}

.help-request-item {
    background: #fff;
    border: 1px solid #ffc107;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

.help-request-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.help-request-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.help-request-header strong {
    color: #856404;
    font-size: 1.1rem;
}

.help-request-header button {
    padding: 0;
    width: 24px;
    height: 24px;
    line-height: 1;
    border-radius: 50%;
    transition: all 0.2s;
}

.help-request-header button:hover {
    background: #f0f0f0;
    color: #dc3545;
}

.help-request-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.help-request-actions button {
    font-weight: 600;
}

.help-question-type {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
}

/* Question Preview in Help Modal */
.help-question-preview {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.help-preview-label {
    font-size: 1.1rem;
    font-weight: bold;
    color: #495057;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
}

.help-preview-content {
    background: white;
    border-radius: 10px;
    padding: 15px;
    min-height: 100px;
}

.help-preview-content .question-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.help-preview-content .answer-btn {
    pointer-events: none;
    opacity: 0.9;
    margin: 5px;
}

.help-preview-content .matching-grid,
.help-preview-content .memory-grid,
.help-preview-content .answer-options {
    pointer-events: none;
}

/* Hide help button in preview */
.help-preview-content [onclick*="requestHelp"],
.help-preview-content .help-request-btn,
.help-preview-content button[onclick*="demander"],
.help-preview-content [class*="help-btn"] {
    display: none !important;
}

/* Visual indicators for player's selections in helper view */
.help-preview-content [data-player-selected="wrong"] {
    border: 3px solid #dc3545 !important;
    background-color: #f8d7da !important;
    position: relative;
    animation: pulse-wrong 2s infinite;
}

@keyframes pulse-wrong {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(220, 53, 69, 0);
    }
}

.help-preview-content [data-player-selected="wrong"] .badge,
.help-preview-content .player-choice-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    font-weight: bold;
}

.help-preview-content [data-correct-answer="true"] {
    border: 3px solid #28a745 !important;
    background-color: #d4edda !important;
}

/* Matching/Memory game indicators */

/* Selected cards (currently being interacted with) */
.help-preview-content [data-player-action="selected"],
.help-preview-content [data-player-action="flipped"] {
    border: 3px solid #ffc107 !important;
    background-color: #fff3cd !important;
    animation: pulse-selected 1.5s infinite;
}

/* Matched/Found cards */
.help-preview-content [data-player-action="matched"] {
    border: 3px solid #28a745 !important;
    background-color: #d4edda !important;
    opacity: 0.8;
}

/* Wrong matches */
.help-preview-content [data-player-action="wrong"] {
    border: 3px solid #dc3545 !important;
    background-color: #f8d7da !important;
}

/* Pulsing animation for active selections */
@keyframes pulse-selected {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(255, 193, 7, 0);
    }
}

/* Memory cards styling in helper view */
.help-preview-content .memory-card {
    position: relative;
}

.help-preview-content .memory-card .badge {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.65rem !important;
    z-index: 10;
}

/* Matching cards styling in helper view */
.help-preview-content .matching-card {
    position: relative;
}

.help-preview-content .matching-card .badge {
    margin-left: 8px;
    font-size: 0.7rem !important;
}

/* Highlight what the player is currently looking at */
.help-preview-content {
    position: relative;
}

.help-preview-content::before {
    content: "👀 Ce que voit " attr(data-player-name);
    position: absolute;
    top: -25px;
    left: 0;
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 600;
}

.help-preview-info {
    padding: 8px 12px;
    background: #e7f3ff;
    border-left: 3px solid #0d6efd;
    border-radius: 5px;
}

.help-preview-legend {
    margin-top: 12px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

.help-preview-note {
    margin-top: 15px;
    padding: 10px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 5px;
    font-size: 0.9rem;
    color: #856404;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .help-notification {
        right: 10px;
        left: 10px;
        max-width: none;
        top: 70px;
    }
    
    .help-modal-overlay {
        padding: 10px;
        align-items: flex-start;
    }
    
    .help-modal-content {
        margin-top: 20px;
        max-height: calc(100vh - 40px);
    }
    
    .help-modal-header {
        padding: 20px;
    }
    
    .help-modal-body {
        padding: 20px;
    }
    
    .help-modal-footer {
        flex-direction: column;
    }
    
    .help-modal-footer button {
        width: 100%;
    }
}

