body {
    font-family: "Manrope", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f6f8;
    color: #1f2430;
}

/* Instagram-подобные посты */
.instagram-post {
    background-color: #fff;
    border: none;
    border-radius: 18px;
    overflow: hidden;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 12px 28px rgba(16, 24, 40, 0.08), 0 2px 6px rgba(16, 24, 40, 0.06);
}

.post-image-container {
    width: 100%;
    background-color: #f1f3f6;
}

.post-image {
    width: 100%;
    display: block;
    object-fit: cover;
    aspect-ratio: 16 / 9;
    max-height: 380px;
}

.post-content {
    padding: 16px 20px 18px;
}

.post-header {
    margin-bottom: 6px;
}

.post-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2430;
}

.post-description {
    font-size: 14px;
    line-height: 1.6;
    color: #4a5568;
    white-space: pre-line;
    word-wrap: break-word;
    margin-top: 2px;
}

.post-meta {
    font-size: 14px;
    color: #4a5568;
    margin-top: 6px;
}

.meta-item {
    display: flex;
    align-items: center;
    color: #2f3747;
}

.meta-item svg {
    color: #98a2b3;
    flex-shrink: 0;
}

.meta-item .text-muted {
    font-weight: 600;
    color: #6b7280 !important;
}

.post-actions {
    margin-top: 8px;
}

.status-pill {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    text-transform: capitalize;
}

.status-lost {
    background-color: #ffe9e7;
    color: #d04a42;
}

.status-found {
    background-color: #e9f0ff;
    color: #2f6fed;
}

.status-returned {
    background-color: #eaf7ed;
    color: #2f8f4e;
}

.comment-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e6e9ef;
    background-color: #fff;
    color: #1f2430;
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 600;
    font-size: 14px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.comment-button:hover {
    border-color: #c7d2fe;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
}

.comment-icon {
    color: #111827;
    display: inline-flex;
}

.comment-count {
    margin-left: 2px;
    background-color: #f3f4f6;
    color: #111827;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
}

/* Адаптивность */
@media (max-width: 768px) {
    .instagram-post {
        border-radius: 14px;
        max-width: 100%;
    }
    
    .post-image {
        max-height: 280px;
    }
}

/* Bottom sheet modal стиль как в Telegram */
.modal-dialog-bottom {
    margin: 0;
    max-width: 100%;
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

.bottom-sheet-modal.show .modal-dialog-bottom {
    transform: translateY(0);
}

/* Force modal to stay at bottom (only when open) */
.bottom-sheet-modal {
    display: none !important;
    align-items: flex-end !important;
    pointer-events: none;
}

.bottom-sheet-modal.show {
    display: flex !important;
    pointer-events: auto;
}

/* Bootstrap keeps hidden modals with aria-hidden="true" */
.bottom-sheet-modal[aria-hidden="true"] {
    display: none !important;
    pointer-events: none;
}

/* Safety: never let hidden modals intercept clicks */
.modal:not(.show) {
    display: none !important;
    pointer-events: none;
}

.modal.show {
    pointer-events: auto;
}

.bottom-sheet-modal .modal-dialog {
    margin: 0;
    max-width: 100%;
    width: 100%;
}

.modal-dialog-bottom .modal-content {
    border-radius: 20px 20px 0 0;
    border: none;
    max-height: 80vh;
    margin: 0;
    position: relative;
}

/* Индикатор для закрытия (полоска сверху как в Telegram) */
.modal-drag-handle {
    width: 40px;
    height: 4px;
    background-color: #ccc;
    border-radius: 2px;
    margin: 8px auto;
    cursor: pointer;
    transition: background-color 0.2s;
}

.modal-drag-handle:hover {
    background-color: #999;
}

.modal-dialog-bottom .modal-header {
    border-bottom: 1px solid #dee2e6;
    border-radius: 20px 20px 0 0;
    padding: 1rem 1.5rem;
}

.modal-dialog-bottom .modal-body {
    padding: 1rem 1.5rem;
    max-height: calc(80vh - 120px);
    overflow-y: auto;
}

.modal.fade .modal-dialog-bottom {
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

.modal.show .modal-dialog-bottom {
    transform: translateY(0);
}

/* Comments list (bottom sheet) */
.comment-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background-color: #f7f8fb;
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e8f0ff;
    color: #2f6fed;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.comment-author {
    font-weight: 600;
    font-size: 14px;
    color: #1f2430;
}

.comment-time {
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
}

.comment-text {
    font-size: 14px;
    line-height: 1.5;
    color: #4a5568;
}

.modal-dialog-bottom .modal-footer {
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 20px 20px;
    padding: 0.75rem 1rem 1rem;
    background-color: #fff;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.modal-dialog-bottom .modal-footer .input-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal-dialog-bottom .modal-footer textarea {
    resize: none;
    min-height: 48px;
}

.modal-dialog-bottom .modal-footer .btn {
    height: 42px;
    width: 42px;
    padding: 0;
    margin-left: 0;
    align-self: center;
}

.send-button {
    margin-top: 1px;
}

.comment-input {
    border-radius: 12px;
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    padding: 10px 12px;
    font-size: 14px;
}

.comment-input:focus {
    background-color: #fff;
    border-color: #c7d2fe;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.12);
}

.send-button {
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Анимация для backdrop */
.bottom-sheet-modal .modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
}

.bottom-sheet-modal.show .modal-backdrop {
    opacity: 1;
}
