/* Custom styles for The BTC Experiment landing page */

/* Bitcoin theme colors and text visibility fixes */
.text-bitcoin {
    color: #F7931A !important;
}

.bg-bitcoin {
    background-color: #F7931A !important;
}

.border-bitcoin {
    border-color: #F7931A !important;
}

/* Ensure text visibility on dark backgrounds */
.text-white {
    color: #ffffff !important;
}

.text-gray-300 {
    color: #d1d5db !important;
}

.text-gray-200 {
    color: #e5e7eb !important;
}

.text-green-200 {
    color: #bbf7d0 !important;
}

.text-orange-200 {
    color: #fed7aa !important;
}

.text-purple-200 {
    color: #e9d5ff !important;
}

.text-yellow-100 {
    color: #fef3c7 !important;
}

.text-blue-200 {
    color: #bfdbfe !important;
}

.text-blue-300 {
    color: #93c5fd !important;
}

/* Force proper scrolling behavior for all devices */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    height: auto;
}

/* Optimized scrolling for admin tables */
.users-table-container {
    /* Enable hardware acceleration for smoother scrolling */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    
    /* Optimize scrolling performance */
    will-change: scroll-position;
    -webkit-overflow-scrolling: touch;
    
    /* Smooth scroll behavior */
    scroll-behavior: smooth;
}

.users-table-container table {
    /* Enable GPU acceleration for table rendering */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    
    /* Optimize table layout for performance */
    table-layout: fixed;
}

.users-table-container tbody tr {
    /* Optimize row rendering */
    contain: layout style paint;
}

/* Smooth pagination transitions */
.pagination-button {
    transition: all 0.2s ease;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

body {
    overflow-x: hidden;
    height: auto;
    min-height: 100vh;
    position: relative;
    -webkit-overflow-scrolling: touch;
}

/* Override any potential conflicting styles */
* {
    box-sizing: border-box;
}

/* Ensure containers don't constrain height */
div[class*="container"], 
div[class*="mx-auto"],
.max-w-7xl {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
}

/* Mobile scrolling fixes */
@media (max-width: 768px) {
    html, body {
        -webkit-overflow-scrolling: touch;
        overflow-x: hidden;
        height: auto;
        position: relative;
    }
    
    /* Fix for mobile viewport issues */
    body {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    
    /* Ensure touch scrolling works properly */
    .max-w-7xl,
    .container,
    .mx-auto {
        touch-action: pan-y;
    }
    
    /* Additional mobile fixes */
    main, section, div {
        position: relative;
        overflow: visible;
    }
    
    /* Fix for gradient backgrounds on mobile */
    .bg-gradient-to-br,
    .bg-gradient-to-r {
        min-height: auto;
        height: auto;
    }
}

/* Custom animations */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

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

/* Falling Bitcoin Animation */
@keyframes fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.bitcoin-falling {
    position: fixed;
    top: -50px;
    z-index: 1;
    pointer-events: none;
    color: #F7931A;
    font-size: 24px;
    animation: fall linear infinite;
}

.bitcoin-falling:nth-child(1) { left: 10%; animation-duration: 8s; animation-delay: 0s; }
.bitcoin-falling:nth-child(2) { left: 20%; animation-duration: 6s; animation-delay: 2s; }
.bitcoin-falling:nth-child(3) { left: 30%; animation-duration: 10s; animation-delay: 4s; }
.bitcoin-falling:nth-child(4) { left: 40%; animation-duration: 7s; animation-delay: 1s; }
.bitcoin-falling:nth-child(5) { left: 50%; animation-duration: 9s; animation-delay: 3s; }
.bitcoin-falling:nth-child(6) { left: 60%; animation-duration: 8s; animation-delay: 5s; }
.bitcoin-falling:nth-child(7) { left: 70%; animation-duration: 6s; animation-delay: 0.5s; }
.bitcoin-falling:nth-child(8) { left: 80%; animation-duration: 11s; animation-delay: 2.5s; }
.bitcoin-falling:nth-child(9) { left: 90%; animation-duration: 7s; animation-delay: 4.5s; }
.bitcoin-falling:nth-child(10) { left: 15%; animation-duration: 9s; animation-delay: 6s; }

/* Adding glow effect for bitcoin elements */
.btc-glow {
    filter: drop-shadow(0 0 8px rgba(247, 147, 26, 0.5));
}

/* Gradient text effect */
.gradient-text {
    background-image: linear-gradient(to right, #F7931A, #FFD700);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #0F172A;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Focus styles for accessibility */
*:focus-visible {
    outline: 2px solid #F7931A;
    outline-offset: 2px;
}

/* Adding subtle grid background for visual interest */
.bg-grid {
    background-size: 40px 40px;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
}

/* Custom styling for input placeholders */
::placeholder {
    color: #64748B;
    opacity: 0.8;
}

/* Improved input focus state transitions */
input, select, textarea, button {
    transition: all 0.3s ease;
}

/* Form validation visual styles */
input.valid {
    border-color: #10B981;
}

input.invalid {
    border-color: #EF4444;
}

/* Bitcoin-themed selection color */
::selection {
    background-color: rgba(247, 147, 26, 0.2);
    color: #F7931A;
}

/* Mobile Touch Improvements */
.touch-manipulation {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}

/* Fix for message images in conversation view */
/* Fixed container for message images to prevent resizing */
.message-image-container {
    display: block;
    text-align: center;
    margin: 12px 0;
    width: 100%;
    height: auto;
}

/* Fixed dimensions and non-shrinking properties for message images */
.message-img {
    display: inline-block;
    max-width: 300px;
    width: auto !important;
    min-width: 200px;
    height: auto !important; 
    border-radius: 8px;
    border: 1px solid #333;
    background-color: #171717;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
    transition: none !important;
    transform: none !important;
}

.conversation-item {
    position: relative;
    padding: 16px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.conversation-item:active {
    background-color: rgba(11, 17, 32, 0.8);
    border-color: rgba(247, 147, 26, 0.5);
}

/* Larger touch targets for mobile */
@media (max-width: 768px) {
    .conversation-item {
        padding: 16px;
        min-height: 80px;
    }
    
    .conversation-item * {
        pointer-events: none; /* Make all children non-interactive so clicks go to parent */
    }
    
    button, .button, .message-actions button {
        min-height: 44px;
        min-width: 44px;
    }
    
    input, textarea, select {
        min-height: 44px;
    }
    
    /* Fix for mobile navigation */
    .mobile-nav-button {
        padding: 12px 16px;
        margin: 0 4px;
    }
}

/* Help Bubble Animations and Styles */
@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    70% {
        transform: scale(1.1) translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(247, 147, 26, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(247, 147, 26, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(247, 147, 26, 0);
    }
}

.help-bubble {
    position: absolute;
    background-color: rgba(15, 23, 42, 0.95);
    border: 2px solid #F7931A;
    border-radius: 12px;
    padding: 10px 15px;
    color: white;
    font-size: 14px;
    max-width: 250px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    animation: popIn 0.5s ease-out forwards;
}

.help-bubble-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background-color: #F7931A;
    color: #0F172A;
    border-radius: 50%;
    cursor: pointer;
    margin-left: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.help-bubble-icon:hover {
    animation: pulse 1.5s infinite;
}

.help-bubble::after {
    content: '';
    position: absolute;
    border-style: solid;
    border-width: 8px;
}

.help-bubble.top::after {
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    border-color: #F7931A transparent transparent transparent;
}

.help-bubble.bottom::after {
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    border-color: transparent transparent #F7931A transparent;
}

.help-bubble.left::after {
    right: -16px;
    top: 50%;
    transform: translateY(-50%);
    border-color: transparent transparent transparent #F7931A;
}

.help-bubble.right::after {
    left: -16px;
    top: 50%;
    transform: translateY(-50%);
    border-color: transparent #F7931A transparent transparent;
}

.help-bubble-content {
    position: relative;
}

.help-bubble-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: #F7931A;
}

.help-bubble-close {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background-color: #475569;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.help-bubble-close:hover {
    background-color: #EF4444;
}

.help-bubble.animate-bounce {
    animation: bounce 1s ease infinite;
}

.help-bubble.animate-wiggle {
    animation: wiggle 1s ease infinite;
}

.help-bubble-icon.pulse {
    animation: pulse 1.5s infinite;
}
