/* assets/css/app.css */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom Utilities */
.text-balance {
    text-wrap: balance;
}

.glass {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
}

/* Smooth transitions */
.transition-all {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


@media (max-width: 480px) {
    .horizontal-scrol {
        max-width: 320px;
    }
}

/* Prevent image saving on mobile */
img[oncontextmenu] {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Prevent long-press menu on images */
@media (pointer: coarse) {
    img[oncontextmenu] {
        -webkit-touch-callout: none !important;
        pointer-events: auto !important;
    }
}

/*Upload CSS Add to your main CSS file */

#fobamiUploadProgress {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#fobamiUploadFill {
    transition: width 0.3s ease-out, background 0.5s ease;
}

@keyframes uploadPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.fa-cloud-upload-alt.animate-pulse {
    animation: uploadPulse 1.5s ease-in-out infinite;
}


/* ============ POST MUSIC PLAYER STYLES ============ */
.post-music-player {
    position: relative;
    overflow: hidden;
}

.post-music-player::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
    animation: musicShimmer 3s infinite;
}



/* Chat messages scrollbar */
#chatMessages::-webkit-scrollbar { width: 6px; }
#chatMessages::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
#chatMessages::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
#chatMessages::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }
.dark #chatMessages::-webkit-scrollbar-track { background: #1a1a1a; }
.dark #chatMessages::-webkit-scrollbar-thumb { background: #404040; }

/* Mobile keyboard handling */
@media (max-width: 768px) {
    #chatModal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        margin: 0;
        max-width: none;
        max-height: none;
    }
    
    /* Adjust when keyboard is open */
    #chatModal:focus-within {
        /* Let the browser handle positioning */
        transform: none;
    }
    
    /* Ensure input stays above keyboard 
    .safe-area-bottom {
        padding-bottom: env(safe-area-inset-bottom, 12px);
    }
    */
    
    /* Fix for iOS 
    @supports (padding-bottom: env(safe-area-inset-bottom)) {
        .safe-area-bottom {
            padding-bottom: max(12px, env(safe-area-inset-bottom));
        }
    }
    */
    
    /* Make text more readable on mobile */
    #chatInput {
        font-size: 16px !important; /* Prevents zoom on focus in iOS */
    }
    
    /* Better touch targets */
    .chat-message button,
    .chat-message [onclick] {
        min-height: 36px;
        min-width: 36px;
    }
}

/* Desktop centering */
@media (min-width: 769px) {
    #chatModal {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90vw;
        max-width: 1200px;
        height: 90vh;
        max-height: 800px;
        border-radius: 24px;
        margin: 0;
    }
}

/* Animation */
@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fade-in 0.2s ease-out; }

/* Better message bubbles on mobile */
@media (max-width: 768px) {
    .chat-message .max-w-\[70\%\] {
        max-width: 85%;
    }
}


@keyframes musicShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Music bar animation */
.music-bar-anim {
    animation: musicBarPulse 0.8s ease-in-out infinite;
    min-height: 4px;
}

@keyframes musicBarPulse {
    0%, 100% { 
        height: 30%; 
        opacity: 0.7;
    }
    50% { 
        height: 100%; 
        opacity: 1;
    }
}

/* Playing state CSS*/

.music-play-btn[data-playing="true"] {
    animation: musicPlayPulse 2s ease-in-out infinite;
}

@keyframes musicPlayPulse {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5);
    }
    50% { 
        box-shadow: 0 0 0 8px rgba(59, 130, 246, 0);
    }
}

/* Hover effect on music card */
.post-music-player:hover {
    border-color: rgba(59, 130, 246, 0.3);
}

.post-music-player:hover .music-bar-anim {
    animation-duration: 0.4s;
}


/* 2026 — ROYAL SHIMMER LOADING */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.shimmer {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255,255,255,0.1) 50%, 
        transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}
.shimmer-dark {
    background: linear-gradient(90deg, 
        #111 0%, 
        #222 50%, 
        #111 100%);
    background-size: 200% 100%;
    animation: shimmer 1.8s infinite;
}


@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.4); }
}
.animate-heartbeat {
    animation: heartbeat 0.6s ease-in-out;
}

.animate-slideup {
    animation: slideup 0.4s ease-out;
}
@keyframes slideup {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* Input validation animations */
input.border-green-500 {
    transition: all 0.2s ease;
}

input.border-red-500 {
    transition: all 0.2s ease;
}

/* Disabled button styling */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}