
:root {
    --app-height: 100vh;
    --app-offset: 0px;
}

/* Prevent iOS bounce/overscroll */
html, body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

/* Prevent iOS from adding extra space for "safe areas" */
@supports (padding: env(safe-area-inset-bottom)) {
    .input-footer {
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom)) !important;
    }
}

/* Make textarea not zoom on iOS (font-size must be >= 16px) */
textarea {
    font-size: 16px !important;
}

/* Prevent pull-to-refresh and bounce effects */
body {
    overscroll-behavior: none;
    -webkit-text-size-adjust: 100%;
}

/* Fix for iOS momentum scrolling */
.overflow-y-auto {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

[x-cloak] { display: none !important; }

.chat-message {
    animation: fadeIn 0.3s ease-in;
    transition: background-color 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.sidebar {
    transition: transform 0.3s ease-in-out;
}

@media (max-width: 768px) {
    .sidebar.collapsed {
        transform: translateX(-100%);
    }
}

.chat-container {
    height: calc(100vh - 120px);
}

.copy-btn {
    opacity: 0;
    transition: opacity 0.2s;
}

.chat-message:hover .copy-btn {
    opacity: 1;
}

.status-indicator {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

mark {
    padding: 2px 4px;
    border-radius: 2px;
}

.relative.overflow-hidden {
    position: relative;
    overflow: hidden;
}

/* Corregge lo stile con cui appaiono le intestazioni nelle tabelle dal formato Markdown */
table {
    display: table !important;
}