/* General Layout */
body {
    font-family: Arial, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 70px 0 0;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Navigation */
.main-nav {
    margin-bottom: 20px;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.navbar-nav .nav-item .nav-link {
    font-size: 1rem;
    padding: 10px 15px;
}

.navbar-nav .nav-item .nav-link.active {
    font-weight: bold;
}

/* Cards and Posts */
.card, .post-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-body {
    padding: 20px;
}

.card-title {
    margin-bottom: 20px;
    font-size: 1.25rem;
    font-weight: bold;
}

.card-text {
    margin-bottom: 20px;
    font-size: 1rem;
    line-height: 1.5;
}

/* Comments */
.comment-item {
    transition: all 0.3s ease;
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-counter {
    font-size: 0.8rem;
    color: #6c757d;
}

.comments-container {
    max-height: none;
    overflow-y: visible;
}

.comment-form textarea {
    resize: none;
}

.reply-btn:hover,
.view-more-comments:hover {
    text-decoration: underline;
}

.view-more-comments {
    color: #007bff;
}

.load-more-comments {
    color: #0d6efd;
    text-decoration: none;
    cursor: pointer;
}

.load-more-comments:hover {
    text-decoration: underline;
    color: #0056b3;
}

/* Like Button Styling */
.like-btn {
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
    padding: 8px 15px;
    border-radius: 20px;
    background: white;
}

.like-btn:hover {
    background-color: #fff5f5;
    transform: scale(1.05);
}

.like-btn i {
    color: #999;
    transition: all 0.3s ease;
}

.like-btn.active,
.like-btn.liked {
    background-color: #ffe6e6;
    border-color: #ffcccc;
}

.like-btn.active i,
.like-btn.liked i {
    color: #ff4444;
    transform: scale(1.2);
}

.like-count {
    margin-left: 5px;
    font-weight: 500;
    color: #ff4444;
}

/* Animation for like action */
@keyframes likeAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.like-btn:active i {
    animation: likeAnimation 0.3s ease;
}

/* Like and Comment Button Styles */
.btn-outline-like {
    color: #ff4444;
    border-color: #ff4444;
    transition: all 0.3s ease;
}

.btn-outline-like:hover {
    background-color: #fff5f5;
    transform: scale(1.05);
}

.btn-outline-like.active {
    background-color: #ffe6e6;
    border-color: #ffcccc;
}

.btn-outline-like.active i {
    color: #ff4444;
    transform: scale(1.2);
}

.btn-outline-comment {
    color: #666;
    border-color: #e0e0e0;
    transition: all 0.3s ease;
}

.btn-outline-comment:hover {
    background-color: #f8f9fa;
}

.like-count, .comment-count {
    margin-left: 5px;
    font-weight: 500;
}

.like-count {
    color: #ff4444;
}

/* Feed Container */
.feed-container {
    padding-top: 20px;
}

/* Floating Action Button */
.floating-action-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #0095f6;
    color: white;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    transition: transform 0.2s;
}

.floating-action-btn:hover {
    transform: scale(1.1);
}

/* Post Card */
.post-card {
    border-radius: 8px;
    margin-bottom: 20px;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.post-header {
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info a {
    text-decoration: none;
    color: inherit;
}

.user-info a:hover {
    text-decoration: underline;
}

.avatar-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
}

.avatar-wrapper a:hover img {
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Post Content */
.post-content {
    padding: 0 12px;
}

.post-image img {
    width: 100%;
    max-height: 600px;
    object-fit: cover;
}

/* Interactions */
.post-interactions {
    padding: 12px;
    display: flex;
    gap: 16px;
}

.btn-interaction {
    background: none;
    border: none;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.like-btn.liked {
    color: #ed4956;
}

.like-btn.liked i {
    animation: likeAnimation 0.3s ease;
}

@keyframes likeAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Comments Section Styling */
.comments-section {
    padding: 12px;
    border-top: 1px solid #efefef;
}

.comment-form {
    margin-top: 12px;
}

.comment-input {
    border: none;
    resize: none;
    padding: 8px 0;
}

.btn-post-comment {
    background: none;
    border: none;
    color: #0095f6;
    padding: 0 12px;
}

.comment-item {
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-content {
    flex: 1;
}

.comment-header {
    margin-bottom: 2px;
}

.comment-text {
    word-break: break-word;
    display: block;
    margin-top: 4px;
    color: #262626;
    visibility: visible;
    opacity: 1;
}


.comment-item {
    padding: 8px 0;
    display: flex;
    align-items: start;
}

.comment-content {
    flex: 1;
}

.comment-meta {
    font-size: 0.8rem;
    color: #8e8e8e;
    margin-top: 4px;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 20px;
}

/* Forms */
form {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 500px;
    margin: 20px auto;
}

input, textarea {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.3s;
    background: #f0f0f0;
}

button:hover {
    background: #e0e0e0;
}

/* Profile Elements */
.profile-picture {
    border-radius: 50%;
    width: 150px;
    height: 150px;
    object-fit: cover;
    margin-bottom: 20px;
}

.profile-info {
    text-align: center;
}

.profile-info h3,
.profile-info p {
    margin-bottom: 10px;
}

.profile-info h3 {
    font-size: 1.5rem;
    font-weight: bold;
}

.profile-info p {
    font-size: 1rem;
    color: #666;
}

.profile-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.profile-actions .btn {
    padding: 10px 20px;
    font-size: 1rem;
}

/* Profile Styles */
.profile-header {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin: 15px 0;
}

.profile-stat-item {
    text-align: center;
}

.profile-stat-count {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.profile-stat-label {
    font-size: 0.875rem;
    color: #666;
}

.profile-bio {
    margin: 15px 0;
    color: #666;
    line-height: 1.6;
}

.profile-posts {
    margin-top: 20px;
}

.post-card {
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Map Elements */
#map,
#mapModalContent {
    height: 300px;
    margin-top: 10px;
}

#mapModalContent {
    height: 400px;
}

#locationMap {
    width: 100%;
    height: 400px !important;
    border-radius: 4px;
}

/* Footer */
.main-footer {
    background: #343a40;
    color: #fff;
    padding: 20px 0;
    text-align: center;
}

.main-footer p {
    margin: 0;
}

/* Utility Classes */
.position-sticky {
    top: 70px;
}

.location-link {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.location-link:hover {
    color: #007bff;
}

.location-link i {
    margin-right: 5px;
}

.comment-item:hover {
    background-color: rgba(0,0,0,0.03);
}

.comment-actions button {
    color: #666;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
}

.comment-input {
    resize: none;
    border-radius: 20px;
}

/* Report Button Styles */
.report-btn {
    color: #dc3545;
}

.report-btn:hover {
    background-color: #fff5f5;
}

.report-btn i {
    color: #dc3545;
}

/* Alert Styles */
.alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    min-width: 300px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Admin Dashboard Tables */
.table {
    width: 100%;
    margin-bottom: 1rem;
    background-color: transparent;
}

.table th,
.table td {
    padding: 0.75rem;
    vertical-align: middle;
    border-top: 1px solid #dee2e6;
}

.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
    background-color: #f8f9fa;
}

/* Recent Posts Section */
.recent-posts {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.recent-posts h2 {
    padding: 1rem;
    margin: 0;
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.recent-posts .table {
    margin-bottom: 0;
}

.recent-posts .delete-post-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.2rem;
    color: #fff;
    background-color: #dc3545;
    border: 1px solid #dc3545;
}

.recent-posts .delete-post-btn:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.username-link {
    color: #262626;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.username-link:hover {
    color: #0095f6;
}

.user-info {
    cursor: pointer;
}

.user-info:hover .username-link {
    text-decoration: underline;
}

.follow-btn.processing {
    opacity: 0.7;
    pointer-events: none;
}

.block-user.processing {
    opacity: 0.7;
    pointer-events: none;
}

/* Google Maps styling */
#map, #locationMap {
    width: 100%;
    height: 300px !important;
    border-radius: 4px;
}

.pac-container {
    z-index: 1055 !important;
}

.modal-open {
    overflow: hidden;
}

.modal {
    overflow-y: hidden;
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 1rem);
}

/* Ensure map is visible in modal */
#map {
    z-index: 1080;
}

/* Loading Spinner Styles */
.loading-spinner {
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--ig-primary, #0095f6);
}

/* Animation for smooth fade in/out */
.loading-spinner.d-none {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loading-spinner:not(.d-none) {
    display: block;
    opacity: 1;
}

/* Loading text styles */
.loading-spinner .text-muted {
    font-size: 0.9rem;
    margin-top: 10px;
    color: #8e8e8e;
}

/* Error state styling */
.loading-spinner .text-danger {
    color: #ed4956;
    font-size: 0.9rem;
    margin-top: 10px;
}

.footer {
    position: relative;
    z-index: 1;
}

.posts-container {
    position: relative;
    z-index: 2;
    min-height: 200px; 
}

.message {
    max-width: 70%;
    margin-bottom: 1rem;
}

.message-own {
    margin-left: auto;
    text-align: right;
}

.message-content {
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    background: #f0f2f5;
}

.message-own .message-content {
    background: #0d6efd;
    color: white;
}

.message-own .message-content .text-muted {
    color: rgba(255,255,255,0.7) !important;
}

.conversations-list {
    max-height: 400px;
    overflow-y: auto;
}

.modal-backdrop {
    display: none;
}

.modal {
    background: rgba(0, 0, 0, 0.5);
}
