/* Enhanced Mobile-First Custom Styles */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0.7; }
    50% { transform: translateY(-20px) rotate(180deg); opacity: 1; }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 5px rgba(0, 212, 255, 0.3); }
    50% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.6); }
}

.game-button {
    animation: pulse-glow 2s ease-in-out infinite;
}

.game-button:hover {
    animation: none;
    box-shadow: 0 0 25px rgba(57, 255, 20, 0.6);
}

.game-button:disabled {
    animation: none;
}

/* Enhanced Mobile Touch Targets */
.touch-manipulation {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 212, 255, 0.3);
    min-height: 44px;
    min-width: 44px;
}

/* Enhanced Mobile Input Styling */
.touch-keyboard-input {
    -webkit-appearance: none;
    appearance: none;
    border-radius: 8px;
    font-size: 16px !important; /* Prevent zoom on iOS */
    line-height: 1.5;
    padding: 16px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

/* Prevent zoom on iOS inputs */
@supports (-webkit-touch-callout: none) {
    input[type="text"],
    input[type="email"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* Enhanced Mobile Focus States */
.touch-keyboard-input:focus {
    transform: none;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
    border-color: #00d4ff !important;
    z-index: 10;
}

/* Active typing indication */
.touch-keyboard-input.typing-active {
    border-color: #39ff14 !important;
    box-shadow: 0 0 0 3px rgba(57, 255, 20, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Custom slider styles - Enhanced for mobile */
.slider {
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: linear-gradient(to right, #2d2d44, #00d4ff);
    outline: none;
    border-radius: 4px;
    touch-action: pan-x;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: #00d4ff;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    touch-action: pan-x;
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: #00d4ff;
    cursor: pointer;
    border-radius: 50%;
    border: none;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* Enhanced Mobile Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(45, 45, 68, 0.3);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #00d4ff, #ff1493);
    border-radius: 6px;
    min-height: 40px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #39ff14, #00d4ff);
}

/* Enhanced Button Hover Effects for Mobile */
button:not(:disabled) {
    transition: all 0.2s ease;
    transform: scale(1);
}

button:not(:disabled):active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

@media (hover: hover) {
    button:not(:disabled):hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
}

/* Mobile-Optimized Tweet Container */
.tweet-container {
    border: 2px solid rgba(29, 161, 242, 0.3);
    background: linear-gradient(135deg, rgba(29, 161, 242, 0.05), rgba(45, 45, 68, 0.8));
}

/* Enhanced Mobile Typography */
@media (max-width: 768px) {
    .font-game {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    body {
        font-size: 16px;
        line-height: 1.5;
    }
    
    input, textarea, select {
        font-size: 16px !important;
        line-height: 1.5 !important;
    }
}

/* Keyboard Active Indicators */
.keyboard-active-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(57, 255, 20, 0.9);
    color: #1a1a2e;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 12px;
    font-weight: bold;
    z-index: 1000;
    animation: pulse 2s infinite;
}

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

/* Enhanced Mobile Grid Layouts */
@media (max-width: 640px) {
    .grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    .flex-wrap > * {
        flex: 1;
        min-width: 120px;
    }
}

/* Mobile-Optimized Character Counter */
.character-counter {
    font-size: 14px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.char-safe { color: #39ff14; }
.char-warning { color: #ffd700; }
.char-danger { color: #ff1493; }

/* Enhanced Mobile Focus Ring */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(0, 212, 255, 0.6);
    outline-offset: 2px;
}

/* Mobile Keyboard Panel Adjustments */
@media (max-width: 768px) {
    .mobile-keyboard-active {
        padding-bottom: 300px;
        transition: padding-bottom 0.3s ease;
    }
    
    .mobile-input-focused {
        position: relative;
        z-index: 100;
    }
}

/* Enhanced Loading States for Mobile */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin-slow {
    animation: spin 3s linear infinite;
}

/* Mobile-Optimized Gradient Effects */
.gradient-text {
    background: linear-gradient(45deg, #00d4ff, #39ff14, #ff1493);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 3s ease-in-out infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Tweet Preview Mobile Enhancement */
.tweet-preview {
    background: #ffffff;
    border: 1px solid #e1e8ed;
    border-radius: 16px;
    padding: 16px;
    font-family: system-ui;
    font-size: 15px;
    line-height: 1.4;
    color: #0f1419;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .tweet-preview {
        font-size: 16px;
        padding: 20px;
        line-height: 1.5;
    }
}

/* Enhanced Concept Highlight for Mobile */
@keyframes concept-highlight {
    0% { background-color: rgba(57, 255, 20, 0.1); }
    50% { background-color: rgba(57, 255, 20, 0.2); }
    100% { background-color: rgba(57, 255, 20, 0.1); }
}

.concept-generated {
    animation: concept-highlight 2s ease-in-out;
}

/* Mobile-Specific Tweet Button Enhancement */
.tweet-button {
    background: linear-gradient(135deg, #1da1f2, #1991db);
    transition: all 0.3s ease;
    min-height: 48px;
}

.tweet-button:active {
    background: linear-gradient(135deg, #1991db, #1a8cd8);
    transform: scale(0.98);
}

/* Enhanced Save Animation for Mobile */
@keyframes save-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.save-animation {
    animation: save-pulse 0.6s ease-in-out;
}

/* Mobile Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    .animate-float,
    .game-button,
    .gradient-text {
        animation: none;
    }
    
    button:not(:disabled):hover {
        transform: none;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .bg-dark-panel {
        background-color: #000000;
        border-color: #ffffff;
    }
    
    .text-light-gray {
        color: #ffffff;
    }
}

/* Mobile Safe Area Adjustments */
@supports (padding: max(0px)) {
    .mobile-safe-area {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}