/* ========================================
   STREETLOG V2 - COMPONENT STYLES PART 2
   Post, Forum, Profile, Admin Styles
   ======================================== */

/* === POST CARDS === */
.post-card {
    background-color: var(--post-card-bg);
    border: 1px solid var(--post-card-border);
    border-radius: 16px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--post-hover-shadow);
}

.post-card .card-body {
    padding: 1.5rem;
}

.post-content-container {
    margin-bottom: 1rem;
}

.post-content-container .card-text {
    line-height: 1.8;
    word-wrap: break-word;
    color: var(--text-color) !important;
    font-size: 1.05rem;
}

/* Post Images */
.post-image {
    overflow: hidden;
    border-radius: 12px;
    width: 100%;
    height: 400px;
    position: relative;
    background-color: var(--surface-hover);
    margin-bottom: 1rem;
}

.post-image-img,
.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.post-image:hover img {
    transform: scale(1.05);
}

@media (max-width: 992px) {
    .post-image {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .post-image {
        height: 300px;
    }
}

@media (max-width: 576px) {
    .post-image {
        height: 250px;
    }
}

/* Post Actions */
.post-actions {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.post-actions a {
    transition: all 0.2s ease;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.post-actions a:hover {
    color: var(--primary-color);
    transform: scale(1.1);
    text-decoration: none;
}

.like-btn.liked {
    color: var(--like-color) !important;
}

.like-btn.liked i {
    font-weight: 900;
    animation: heartBeat 0.3s ease;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1.1); }
}

/* Highlight Animation */
.highlight-post {
    animation: highlightFade 3s ease-in-out;
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.3) !important;
    border: 2px solid var(--primary-color) !important;
}

@keyframes highlightFade {
    0% { background-color: rgba(37, 99, 235, 0.15); }
    100% { background-color: transparent; }
}

/* === FAB (Floating Action Button) === */
.fab {
    position: fixed;
    right: 20px;
    bottom: 80px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 24px;
}

.fab:hover {
    transform: scale(1.15) rotate(90deg);
    box-shadow: var(--shadow-xl);
}

@media (min-width: 768px) {
    .fab {
        bottom: 20px;
    }
}

/* === VIEW POST PAGE === */
.view-post-container {
    max-width: 900px;
    margin: 0 auto;
}

.post-card-detailed {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

.post-content-detailed {
    font-size: 1.15rem;
    line-height: 1.9;
    word-wrap: break-word;
    color: var(--text-color);
}

.post-content-detailed a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
}

/* === COMMENTS === */
.comments-section {
    margin-top: 2rem;
}

.comments-section h4 {
    color: var(--text-color);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.comment {
    margin-bottom: 1.5rem;
}

.comment-bubble {
    background-color: var(--surface-hover);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 12px 16px;
    display: inline-block;
    max-width: 100%;
    transition: all 0.2s ease;
}

.comment-bubble:hover {
    background-color: var(--surface-color);
    box-shadow: var(--shadow-sm);
}

.comment-content p {
    font-size: 0.95rem;
    word-wrap: break-word;
    color: var(--text-color);
    margin: 0;
}

.comment-textarea {
    resize: none;
    overflow: hidden;
    min-height: 44px;
    border-radius: 24px !important;
    transition: height 0.2s ease;
    background-color: var(--surface-color);
    border: 2px solid var(--border-color);
    color: var(--text-color);
    padding: 10px 16px;
}

.comment-textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* Reply to Comment */
.comment-reply {
    margin-left: 3rem;
    padding-left: 1rem;
    border-left: 3px solid var(--border-color);
}

/* === PROFILE PAGE === */
.profile-header-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: var(--surface-color);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.profile-avatar-large:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

.profile-text h1 {
    margin: 0 0 10px 0;
    color: var(--text-color);
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-text p {
    margin: 0;
    color: var(--text-secondary);
}

.follow-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.follow-stats div {
    display: flex;
    flex-direction: column;
}

.follow-stats strong {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 800;
}

.follow-stats span {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.profile-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.profile-actions .btn {
    padding: 10px 20px;
    white-space: nowrap;
    font-weight: 600;
}

@media (max-width: 768px) {
    .profile-header-container {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-info {
        flex-direction: column !important;
        text-align: center;
    }
    
    .profile-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .profile-actions .btn {
        width: 100%;
    }
}

/* === ADMIN PANEL === */
.admin-panel {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    min-height: calc(100vh - 140px);
}

.admin-panel h1,
.admin-panel h2,
.admin-panel h3 {
    color: var(--text-color);
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    flex-wrap: wrap;
    overflow-x: auto;
}

.tab-button {
    padding: 12px 24px;
    border: none;
    background: var(--surface-color);
    color: var(--text-color);
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    border: 2px solid transparent;
    white-space: nowrap;
    position: relative;
}

.tab-button:hover {
    background: var(--surface-hover);
    transform: translateY(-2px);
}

.tab-button.active {
    background: var(--primary-color);
    color: white;
    border-bottom: 2px solid var(--primary-color);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.admin-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.admin-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.admin-section {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 16px;
    margin-top: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--surface-color), var(--surface-hover));
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.stat-card p {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.admin-table thead {
    background-color: var(--surface-hover);
}

.admin-table th {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-table tbody tr {
    transition: all 0.2s ease;
}

.admin-table tbody tr:hover {
    background-color: var(--surface-hover);
    transform: scale(1.01);
}

.admin-table .actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-table .btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

/* === MESSAGES PAGE === */
.messages-page-container {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 60px;
    display: flex;
    overflow: hidden;
    background: var(--background-color);
}

@media (max-width: 767px) {
    .messages-page-container {
        top: 0;
        bottom: 60px;
        flex-direction: column;
    }
}

.conversations-sidebar {
    width: 100%;
    max-width: 380px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: var(--surface-color);
}

@media (max-width: 767px) {
    .conversations-sidebar {
        max-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        height: 40vh;
    }
}

.conversation-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface-color);
    color: var(--text-color);
    text-decoration: none;
}

.conversation-item:hover {
    background: var(--surface-hover);
    transform: translateX(4px);
}

.conversation-item.active {
    background: var(--primary-color);
    color: white;
    border-left: 4px solid var(--primary-color);
}

.conversation-item.active * {
    color: white !important;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--background-color);
    position: relative;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--background-color);
}

.message-group.received .message-bubble {
    background: var(--message-bubble-received);
    color: var(--message-text-received);
    border-bottom-left-radius: 4px;
}

.message-group.sent .message-bubble {
    background: var(--message-bubble-sent);
    color: var(--message-text-sent);
    border-bottom-right-radius: 4px;
}

.chat-input-container {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--surface-color);
}

.chat-input {
    flex: 1;
    resize: none;
    border: 2px solid var(--border-color);
    border-radius: 24px;
    padding: 12px 16px;
    background: var(--background-color);
    color: var(--text-color);
    min-height: 44px;
    max-height: 120px;
}

.chat-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.chat-send-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

/* === MAP STYLES === */
body.view-map {
    padding: 0;
    overflow: hidden;
}

body.view-map .main-content {
    height: 100vh;
    padding: 0;
}

#map {
    height: calc(100vh - 60px);
    width: 100%;
    position: relative;
    z-index: 1;
}

@media (min-width: 768px) {
    #map {
        height: calc(100vh - 70px);
    }
}

/* Map Controls */
.map-fab {
    position: fixed;
    right: 20px;
    bottom: 80px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    cursor: pointer;
    transition: all 0.3s ease;
}

.map-fab:hover {
    transform: scale(1.15);
    box-shadow: var(--shadow-xl);
}

#filter-toggle {
    position: fixed;
    top: 20px;
    left: 10px;
    z-index: 1050;
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 20px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    color: var(--text-color);
    font-weight: 600;
    transition: all 0.2s ease;
}

#filter-toggle:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

#filter-container {
    position: fixed;
    top: 80px;
    left: 10px;
    z-index: 1050;
    background: var(--surface-color);
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    width: 320px;
    max-width: calc(100vw - 40px);
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
}

@media (min-width: 768px) {
    #filter-toggle {
        top: 90px;
    }
    
    #filter-container {
        top: 150px;
    }
}

/* === LOADING SPINNER === */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

/* === UTILITIES === */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow {
    box-shadow: var(--shadow) !important;
}

.shadow-md {
    box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

.rounded-3 {
    border-radius: 16px !important;
}

/* === RESPONSIVE === */
@media (max-width: 576px) {
    .post-card .card-body {
        padding: 1rem;
    }
    
    .post-actions {
        gap: 1rem !important;
    }
    
    .admin-tabs {
        flex-direction: column;
    }
    
    .tab-button {
        width: 100%;
        border-radius: 8px;
    }
}

/* === FIXES === */
.container, 
.container-fluid {
    margin-bottom: 80px;
}

@media (min-width: 768px) {
    .container, 
    .container-fluid {
        margin-bottom: 20px;
    }
}

/* Ensure dark mode works properly on all elements */
[data-theme="dark"] * {
    border-color: var(--border-color);
}

[data-theme="dark"] hr {
    border-color: var(--border-color);
    opacity: 1;
}
