/* mobile-enhancements.css - Enhanced mobile interactions and new features */

/* ===========================================
   HAPTIC FEEDBACK VISUAL CUES
   =========================================== */

/* Long press visual feedback */
.dice-button.long-pressed {
    transform: scale(0.95) !important;
    background: var(--accent-blue) !important;
    box-shadow: 0 0 20px var(--accent-blue) !important;
    transition: all 0.1s ease !important;
}

/* Haptic feedback indicator */
.haptic-pulse {
    animation: hapticPulse 0.3s ease-out;
}

@keyframes hapticPulse {
    0% { 
        transform: scale(1); 
        box-shadow: 0 0 0 0 var(--accent-blue); 
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: 0 0 0 10px rgba(0, 212, 255, 0.3); 
    }
    100% { 
        transform: scale(1); 
        box-shadow: 0 0 0 0 rgba(0, 212, 255, 0); 
    }
}

/* ===========================================
   TOUCH GESTURE HINTS
   =========================================== */

/* Swipe hint overlay */
.swipe-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dice-selection:hover .swipe-hint,
.dice-selection:focus-within .swipe-hint {
    opacity: 1;
}

/* Gesture indicator icons */
.gesture-indicator {
    position: relative;
}

.gesture-indicator::after {
    content: '';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 16px;
    height: 16px;
    background: var(--accent-blue);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
}

.gesture-indicator.show-hint::after {
    opacity: 1;
    transform: scale(1);
    animation: pulseGesture 2s infinite;
}

@keyframes pulseGesture {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Long press hint text */
.long-press-hint {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--text-secondary);
    background: var(--glass-bg);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.dice-button:hover .long-press-hint,
.dice-button:focus .long-press-hint {
    opacity: 1;
}

/* ===========================================
   FEEDBACK SYSTEM STYLES
   =========================================== */

/* Feedback floating button enhancements */
.feedback-floating-button {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.feedback-floating-button .feedback-tooltip {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-bg);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.feedback-floating-button:hover .feedback-tooltip {
    opacity: 1;
}

/* Feedback modal enhancements */
.feedback-modal {
    z-index: 2000;
}

.feedback-content {
    max-width: 500px;
    width: 95%;
    margin: 2rem auto;
    max-height: 90vh;
    overflow-y: auto;
}

.feedback-body {
    padding: 1.5rem;
}

.feedback-step {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.feedback-step:not([style*="display: none"]) {
    opacity: 1;
    transform: translateY(0);
}

/* Star rating system */
.star-rating {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.star {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.star:hover,
.star:focus {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.1);
}

.star.selected .star-icon {
    filter: drop-shadow(0 0 10px gold);
}

.rating-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Form styling */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group textarea {
    width: 100%;
    min-height: 80px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
}

.char-count {
    text-align: right;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Feedback actions */
.feedback-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.primary-btn, .secondary-btn, .tertiary-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.primary-btn {
    background: var(--accent-blue);
    color: white;
}

.primary-btn:hover {
    background: var(--accent-blue-hover, #0099cc);
    transform: translateY(-1px);
}

.secondary-btn {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tertiary-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.tertiary-btn:hover {
    color: var(--text-primary);
    background: var(--glass-bg);
}

/* Thank you step */
.feedback-thank-you {
    text-align: center;
    padding: 2rem 1rem;
}

.thank-you-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 1s ease-out;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* ===========================================
   TOAST ENHANCEMENTS FOR FEEDBACK
   =========================================== */

.toast.feedback-prompt {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border: none;
    max-width: 350px;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
}

.toast-action {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-action:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* ===========================================
   ENHANCED MOBILE INTERACTIONS
   =========================================== */

/* Touch-friendly button sizes */
@media (max-width: 768px) {
    .dice-button {
        min-height: 48px;
        min-width: 48px;
        font-size: 0.9rem;
    }
    
    .quick-roll-btn {
        min-height: 60px;
        min-width: 80px;
        padding: 1rem 0.75rem;
    }
    
    .star {
        width: 50px;
        height: 50px;
        font-size: 1.8rem;
    }
    
    .feedback-floating-button {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
}

/* Touch feedback for all interactive elements */
.dice-button:active,
.quick-roll-btn:active,
.fancy-button:active,
.roll-button:active {
    transform: scale(0.98);
}

/* Improved focus styles for accessibility */
.dice-button:focus,
.quick-roll-btn:focus,
.star:focus,
.feedback-floating-button:focus {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* ===========================================
   GESTURE VISUAL FEEDBACK
   =========================================== */

/* Swipe animation indicators */
.swipe-left-indicator,
.swipe-right-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.swipe-left-indicator {
    left: -30px;
    color: var(--accent-blue);
}

.swipe-right-indicator {
    right: -30px;
    color: var(--accent-purple);
}

.dice-selection.show-swipe-hint .swipe-left-indicator,
.dice-selection.show-swipe-hint .swipe-right-indicator {
    opacity: 0.6;
    animation: swipeHint 2s ease-in-out infinite;
}

@keyframes swipeHint {
    0%, 100% { opacity: 0.3; transform: translateY(-50%) translateX(0); }
    50% { opacity: 0.8; }
}

@keyframes swipeHint {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.swipe-left-indicator {
    animation: swipeHintLeft 2s ease-in-out infinite;
}

.swipe-right-indicator {
    animation: swipeHintRight 2s ease-in-out infinite;
}

@keyframes swipeHintLeft {
    0%, 100% { opacity: 0.3; transform: translateY(-50%) translateX(0); }
    50% { opacity: 0.8; transform: translateY(-50%) translateX(-10px); }
}

@keyframes swipeHintRight {
    0%, 100% { opacity: 0.3; transform: translateY(-50%) translateX(0); }
    50% { opacity: 0.8; transform: translateY(-50%) translateX(10px); }
}

/* ===========================================
   DARK MODE ADJUSTMENTS
   =========================================== */

@media (prefers-color-scheme: dark) {
    .feedback-floating-button {
        box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
    }
    
    .toast.feedback-prompt {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    
    .form-group textarea {
        background: rgba(255, 255, 255, 0.05);
    }
}

/* ===========================================
   ACCESSIBILITY ENHANCEMENTS
   =========================================== */

/* High contrast mode support */
@media (prefers-contrast: high) {
    .dice-button:focus,
    .quick-roll-btn:focus {
        outline: 3px solid currentColor;
        outline-offset: 3px;
    }
    
    .star.selected .star-icon {
        filter: brightness(1.5);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .haptic-pulse,
    .bounce,
    .swipe-left-indicator,
    .swipe-right-indicator {
        animation: none;
    }
    
    .feedback-step,
    .dice-button,
    .star {
        transition: none;
    }
}

/* ===========================================
   LOADING STATES
   =========================================== */

.loading-pulse {
    opacity: 0.6;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}
