/**
 * Hint System Styles
 * Styles for error reflection feature discovery hints
 */

/* Hint Container */
.hint-container {
    position: fixed;
    z-index: 10000;
    max-width: 350px;
    font-family: 'Noto Sans SC', system-ui, sans-serif;
    pointer-events: auto;
}

/* Hint Card */
.hint-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 179, 71, 0.2);
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(10px);
    animation: hintSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1), hintGlow 3s ease-in-out infinite;
}

.hint-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #FFB347, #FF7B54);
}

/* Hint Header */
.hint-header {
    display: flex;
    align-items: center;
    padding: 16px 16px 12px 16px;
    gap: 12px;
    position: relative;
}

.hint-icon {
    font-size: 20px;
    flex-shrink: 0;
    animation: hintIconPulse 2s ease-in-out infinite;
}

.hint-title {
    font-weight: 600;
    font-size: 16px;
    color: #2D3436;
    flex: 1;
    line-height: 1.3;
}

.hint-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #666;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hint-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

.hint-close:active {
    transform: scale(0.95);
}

/* Hint Content */
.hint-content {
    padding: 0 16px 16px 16px;
}

.hint-message {
    font-size: 14px;
    line-height: 1.5;
    color: #2D3436;
    margin-bottom: 8px;
}

.hint-message-cn {
    font-size: 13px;
    line-height: 1.4;
    color: #666;
    font-style: italic;
}

.hint-stats {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.hint-stat-badge {
    background: rgba(255, 179, 71, 0.1);
    color: #FF9F1C;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(255, 179, 71, 0.2);
}

/* Hint Actions */
.hint-actions {
    padding: 12px 16px 16px 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hint-btn {
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    line-height: 1.3;
    position: relative;
    overflow: hidden;
}

.hint-btn:active {
    animation: hintButtonPress 0.15s ease-out;
}

.hint-btn-primary {
    background: linear-gradient(135deg, #FFB347, #FF9F1C);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 179, 71, 0.3);
}

.hint-btn-primary:hover {
    background: linear-gradient(135deg, #FF9F1C, #FF8C00);
    box-shadow: 0 4px 12px rgba(255, 179, 71, 0.4);
    transform: translateY(-1px);
}

.hint-btn-primary small {
    opacity: 0.9;
    font-size: 12px;
}

.hint-btn-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.hint-btn-secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.hint-btn-text {
    background: none;
    color: #6c757d;
    font-size: 13px;
    padding: 8px 16px;
}

.hint-btn-text:hover {
    color: #495057;
    background: rgba(0, 0, 0, 0.02);
}

/* Animations */
@keyframes hintSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes hintSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}

@keyframes hintIconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes hintButtonPress {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes hintGlow {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    }
    50% {
        box-shadow: 0 8px 32px rgba(255, 179, 71, 0.2), 0 2px 8px rgba(255, 179, 71, 0.1);
    }
}

/* Temporary Message Styles */
.hint-temp-message {
    font-size: 14px;
    line-height: 1.4;
    animation: hintMessageSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes hintMessageSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hint-container {
        left: 10px !important;
        right: 10px !important;
        top: 10px !important;
        max-width: none;
        transform: none !important;
    }
    
    .hint-card {
        border-radius: 8px;
    }
    
    .hint-header {
        padding: 14px 14px 10px 14px;
    }
    
    .hint-content {
        padding: 0 14px 14px 14px;
    }
    
    .hint-actions {
        padding: 10px 14px 14px 14px;
    }
    
    .hint-title {
        font-size: 15px;
    }
    
    .hint-message {
        font-size: 13px;
    }
    
    .hint-message-cn {
        font-size: 12px;
    }
    
    .hint-btn {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px; /* Touch target */
    }
    
    .hint-close {
        padding: 8px;
        min-width: 32px;
        min-height: 32px;
    }
}

@media (max-width: 480px) {
    .hint-container {
        left: 8px !important;
        right: 8px !important;
        top: 8px !important;
    }
    
    .hint-header {
        padding: 12px 12px 8px 12px;
    }
    
    .hint-content {
        padding: 0 12px 12px 12px;
    }
    
    .hint-actions {
        padding: 8px 12px 12px 12px;
    }
    
    .hint-title {
        font-size: 14px;
    }
    
    .hint-message {
        font-size: 12px;
    }
    
    .hint-message-cn {
        font-size: 11px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hint-card {
        border: 2px solid #000;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }
    
    .hint-btn-primary {
        background: #000;
        color: #fff;
    }
    
    .hint-btn-secondary {
        border: 2px solid #000;
        background: #fff;
        color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .hint-card {
        animation: none;
    }
    
    .hint-icon {
        animation: none;
    }
    
    .hint-container {
        transition: none !important;
    }
    
    .hint-btn {
        transition: none;
    }
    
    .hint-btn:hover {
        transform: none;
    }
    
    .hint-btn:active {
        transform: none;
    }
}

/* Dark mode support (if implemented) */
@media (prefers-color-scheme: dark) {
    .hint-card {
        background: #2d3748;
        border-color: rgba(255, 179, 71, 0.3);
        color: #e2e8f0;
    }
    
    .hint-title {
        color: #f7fafc;
    }
    
    .hint-message {
        color: #e2e8f0;
    }
    
    .hint-message-cn {
        color: #a0aec0;
    }
    
    .hint-close {
        color: #a0aec0;
    }
    
    .hint-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #e2e8f0;
    }
    
    .hint-btn-secondary {
        background: #4a5568;
        color: #e2e8f0;
        border-color: #718096;
    }
    
    .hint-btn-secondary:hover {
        background: #2d3748;
        border-color: #a0aec0;
    }
    
    .hint-btn-text {
        color: #a0aec0;
    }
    
    .hint-btn-text:hover {
        color: #e2e8f0;
        background: rgba(255, 255, 255, 0.05);
    }
    
    .hint-actions {
        border-top-color: rgba(255, 255, 255, 0.1);
    }
}

/* Focus styles for accessibility */
.hint-btn:focus,
.hint-close:focus {
    outline: 2px solid #FFB347;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .hint-container {
        display: none !important;
    }
}
/* Addi
tional Accessibility Enhancements */

/* Touch-friendly button sizing for all interactive elements */
.hint-container button,
.hint-container .hint-action,
.category-option,
.reflection-button,
.modal-overlay button {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 16px;
    touch-action: manipulation;
}

/* Screen reader only content */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Enhanced focus indicators for better accessibility */
.hint-action:focus,
.category-option:focus,
.reflection-button:focus,
.modal-overlay button:focus,
[role="button"]:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.3);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hint-container {
        border: 2px solid;
        background: Canvas;
        color: CanvasText;
    }
    
    .hint-action,
    .category-option,
    .reflection-button {
        border: 2px solid ButtonText;
        background: ButtonFace;
        color: ButtonText;
    }
    
    .modal-overlay {
        background: Canvas;
        color: CanvasText;
        border: 2px solid;
    }
}

/* Disable hover effects on touch devices */
@media (hover: none) and (pointer: coarse) {
    .hint-action:hover,
    .category-option:hover,
    .reflection-button:hover {
        transform: none;
        box-shadow: none;
    }
}

/* Additional mobile touch optimizations */
@media (max-width: 768px) {
    .hint-container button,
    .category-option,
    .reflection-button {
        min-height: 48px;
        min-width: 48px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
}