* {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

html {
    height: 100%;
    height: -webkit-fill-available;
}

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    direction: rtl;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

/* RTL specific adjustments */
input[type="tel"],
input[type="text"][dir="ltr"] {
    direction: ltr;
    text-align: center;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.chat-container {
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
}

@media (max-width: 1024px) {
    .chat-container {
        height: 100%;
        min-height: calc(100vh - 180px);
    }
}

.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.chat-input-container {
    flex-shrink: 0;
}

/* Mobile height fixes */
@media (max-width: 1024px) {
    .mobile-quick-btn {
        display: block;
        margin: 1rem;
        margin-top: 0.5rem;
    }
    
    .desktop-sidebar {
        display: none;
    }
    
    .chat-main-area {
        grid-column: span 1;
    }
    
    .chat-step {
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
        display: flex;
        flex-direction: column;
    }
    
    .mobile-content-wrapper {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    
    .chat-container {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        max-height: calc(100vh - 160px);
        max-height: calc(var(--vh, 1vh) * 100 - 160px);
    }
    
    .chat-messages-container {
        flex: 1;
        overflow-y: auto;
        min-height: 200px;
        max-height: calc(100vh - 240px);
        max-height: calc(var(--vh, 1vh) * 100 - 240px);
        -webkit-overflow-scrolling: touch;
    }
    
    .chat-input-container {
        flex-shrink: 0;
        background: white;
        min-height: 80px;
    }
}
/* Animation for messages */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-animation {
    animation: fadeInUp 0.3s ease-out;
}

/* Custom styles for better mobile experience */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .order-2 {
        order: 2;
    }

    .order-1 {
        order: 1;
    }
}

/* Smooth transitions */
.transition-all {
    transition: all 0.2s ease-in-out;
}

/* Focus states */
input:focus {
    outline: none;
}

/* Message bubble styles */
.user-message {
    background: linear-gradient(to right, #ec4899, #9333ea);
    color: white;
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    max-width: 20rem;
    margin-left: auto;
}

.bot-message {
    background: #f3f4f6;
    color: #1f2937;
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    max-width: 20rem;
    margin-right: auto;
}

.message-time {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    opacity: 0.7;
}

/* Quick question buttons */
.quick-question-btn {
    width: 100%;
    text-align: right;
    padding: 0.75rem;
    background: linear-gradient(to right, #fdf2f8, #faf5ff);
    border-radius: 0.5rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
}

.quick-question-btn:hover {
    background: linear-gradient(to right, #fce7f3, #f3e8ff);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Loading animation */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: loading 1.5s infinite;
}

@keyframes loading {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60%,
    100% {
        content: '...';
    }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .lg\:col-span-1 {
        grid-column: span 1;
    }

    .lg\:col-span-3 {
        grid-column: span 1;
    }

    .lg\:order-1 {
        order: 1;
    }

    .lg\:order-2 {
        order: 2;
    }
}

/* Custom gradient backgrounds */
.bg-gradient-to-br {
    background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
}

.from-rose-50 {
    --tw-gradient-from: #fff1f2;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(255, 241, 242, 0));
}

.via-pink-50 {
    --tw-gradient-to: rgba(253, 242, 248, 0);
    --tw-gradient-stops: var(--tw-gradient-from), #fdf2f8, var(--tw-gradient-to, rgba(253, 242, 248, 0));
}

.to-purple-50 {
    --tw-gradient-to: #faf5ff;
}

/* Button gradients */
.bg-gradient-to-r {
    background-image: linear-gradient(to right, var(--tw-gradient-stops));
}

.from-pink-500 {
    --tw-gradient-from: #ec4899;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(236, 72, 153, 0));
}

.to-purple-600 {
    --tw-gradient-to: #9333ea;
}

.hover\:from-pink-600:hover {
    --tw-gradient-from: #db2777;
}

.hover\:to-purple-700:hover {
    --tw-gradient-to: #7c3aed;
}

/* Mobile quick questions button */
.mobile-quick-btn {
    display: none;
    margin: 1rem;
    margin-top: 1rem;
}

.quick-questions-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: 1rem;
}

.popup-content {
    background: white;
    border-radius: 1rem;
    max-height: 80vh;
    overflow-y: auto;
    margin-top: 10vh;
}

@media (max-width: 1024px) {
    .mobile-quick-btn {
        display: block;
    }

    .desktop-sidebar {
        display: none;
    }

    .chat-main-area {
        grid-column: span 1;
    }
}

/* Audio player styling */
.voice-message-audio {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px;
    width: 200px;
    height: 40px;
}

.voice-message-audio::-webkit-media-controls-panel {
    background-color: transparent;
}

.voice-message-audio::-webkit-media-controls-play-button,
.voice-message-audio::-webkit-media-controls-pause-button {
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    margin-right: 8px;
}

.voice-message-audio::-webkit-media-controls-timeline {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    margin: 0 8px;
}

/* Fix for user messages - black text on white controls */
.user-message .voice-message-audio::-webkit-media-controls-current-time-display,
.user-message .voice-message-audio::-webkit-media-controls-time-remaining-display {
    color: black;
    font-size: 12px;
    font-weight: 500;
}

/* For bot messages - keep dark text */
.bot-message .voice-message-audio::-webkit-media-controls-current-time-display,
.bot-message .voice-message-audio::-webkit-media-controls-time-remaining-display {
    color: #374151;
    font-size: 12px;
    font-weight: 500;
}