/* Global Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    padding-top: 56px;
}

:root {
    --primary-color: #344F7E;
    --secondary-color: #273A5C;
    --text-color: #333;
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --border-color: #e4e6eb;
}

/* Button Color Fixes */
.btn-primary {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color)) !important;
    border: none !important;
    color: white !important;
    transition: all 0.3s ease;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: linear-gradient(to right, var(--secondary-color), var(--primary-color)) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 79, 126, 0.3) !important;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color) !important;
    color: var(--primary-color) !important;
    background: transparent !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    background: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
}

.bg-primary {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color)) !important;
}



/* Navigation */
.navbar {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color)) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

/* Main Container */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 15px;
}

/* Sidebar */
.sidebar {
    padding: 0 10px;
}

.sidebar .card {
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: var(--card-bg);
}

.sidebar .card:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.sidebar .card-header {
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding: 15px 20px;
    font-weight: 700;
    font-size: 1rem;
}

.sidebar .list-group-item {
    border: none;
    padding: 14px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar .list-group-item:hover {
    background: linear-gradient(to right, rgba(52, 79, 126, 0.1), rgba(39, 58, 92, 0.05));
    border-left-color: var(--primary-color);
    transform: translateX(5px);
}

.sidebar .list-group-item i {
    transition: transform 0.2s;
}

.sidebar .list-group-item:hover i {
    transform: scale(1.2);
}

.profile-pic {
    margin: 15px 0;
    transition: transform 0.3s;
    display: inline-block;
}

.profile-pic:hover {
    transform: scale(1.05);
}

.profile-pic i {
    filter: drop-shadow(0 4px 8px rgba(52, 79, 126, 0.3));
}

/* Avatar Upload Styles */
.avatar-upload-label {
    cursor: pointer;
    display: inline-block;
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    transition: all 0.3s ease;
}

.avatar-upload-label:hover .avatar-overlay {
    opacity: 1;
}

.avatar-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(52, 79, 126, 0.3);
}

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(52, 79, 126, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: white;
    font-size: 1.5rem;
}

.create-post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    box-shadow: 0 2px 8px rgba(52, 79, 126, 0.3);
}

/* Feed Container */
.feed-container {
    padding: 0 15px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Create Post Card */
.create-post-card {
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 15px;
    margin-bottom: 25px;
    background: var(--card-bg);
    transition: all 0.3s ease;
}

.create-post-card:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
}

.create-post-card .card-body {
    padding: 20px;
}

.profile-icon {
    flex-shrink: 0;
    color: var(--primary-color);
    transition: transform 0.2s;
}

.profile-icon:hover {
    transform: scale(1.1);
}

#postText {
    border-radius: 12px;
    border: 2px solid var(--border-color);
    padding: 12px 18px;
    transition: all 0.3s ease;
    flex: 1;
    font-size: 0.95rem;
    background: #fafbfc;
}

#postText:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 4px rgba(52, 79, 126, 0.15);
    background: white;
}

#imageFileName {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
    padding: 6px 12px;
    background: rgba(52, 79, 126, 0.1);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#imageFileName::before {
    content: "📷";
    font-size: 1rem;
}

/* Post Card */
.post-card {
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 15px;
    margin-bottom: 25px;
    background: var(--card-bg);
    transition: all 0.3s ease;
    overflow: hidden;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.post-header {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(to right, rgba(52, 79, 126, 0.02), rgba(39, 58, 92, 0.02));
    position: relative;
}

/* Post Menu Dropdown */
.post-menu-dropdown {
    position: absolute;
    right: 20px;
    top: 18px;
}

.post-menu-btn {
    background: none;
    border: none;
    color: #65676b;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-menu-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

.post-menu {
    position: absolute;
    right: 0;
    top: 40px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 150px;
    z-index: 1000;
    overflow: hidden;
}

.post-menu button {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: white;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    color: var(--text-color);
    font-size: 0.9rem;
}

.post-menu button:hover {
    background: #f0f2f5;
}

.post-menu button:first-child {
    color: var(--primary-color);
}

.post-menu button:last-child {
    color: #e74c3c;
}

.post-author-pic {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    margin-right: 15px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(52, 79, 126, 0.3);
    transition: transform 0.2s;
    overflow: hidden;
    position: relative;
}

.post-author-pic:hover {
    transform: scale(1.05);
}

.post-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.post-author-info {
    flex: 1;
}

.post-author-name {
    font-weight: 700;
    margin: 0;
    font-size: 1rem;
    color: var(--text-color);
    letter-spacing: 0.3px;
}

.post-time {
    font-size: 0.85rem;
    color: #65676b;
    margin: 2px 0 0 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-time::before {
    content: "•";
    color: var(--primary-color);
    margin-right: 5px;
}

.post-content {
    padding: 20px;
}

.post-text {
    margin-bottom: 15px;
    line-height: 1.7;
    color: var(--text-color);
    font-size: 0.95rem;
    word-wrap: break-word;
}

.post-image-container {
    margin: 15px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.post-image-container:hover {
    transform: scale(1.01);
}

.post-image {
    width: 100%;
    height: auto;
    display: block;
    max-height: 600px;
    object-fit: cover;
    cursor: pointer;
}

.post-actions {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    background: #fafbfc;
}

.post-action-btn {
    background: none;
    border: none;
    color: #65676b;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.post-action-btn:hover {
    background: linear-gradient(to right, rgba(52, 79, 126, 0.1), rgba(39, 58, 92, 0.1));
    color: var(--primary-color);
    transform: translateY(-2px);
}

.post-action-btn.liked {
    color: #e74c3c !important;
}

.post-action-btn.liked:hover {
    background: rgba(231, 76, 60, 0.1) !important;
    color: #e74c3c !important;
}

.post-action-btn.liked i {
    animation: heartBeat 0.5s ease;
    color: #e74c3c;
}

@keyframes heartBeat {

    0%,
    100% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.3);
    }

    50% {
        transform: scale(1.1);
    }

    75% {
        transform: scale(1.2);
    }
}

.post-action-btn i {
    font-size: 1.1rem;
    transition: transform 0.2s;
}

.post-action-btn:hover i {
    transform: scale(1.2);
}

.post-action-btn i {
    font-size: 1.1rem;
}

/* Comments Section */
.comments-section {
    padding: 0 20px 20px;
    border-top: 1px solid var(--border-color);
    background: linear-gradient(to bottom, #fafbfc, #ffffff);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comment-input-group {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    margin-bottom: 15px;
}

.comment-input {
    flex: 1;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    padding: 10px 18px;
    font-size: 0.9rem;
    background: white;
    transition: all 0.3s ease;
}

.comment-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 4px rgba(52, 79, 126, 0.1);
    background: #fafbfc;
}

.comment-btn {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 25px;
    padding: 10px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(52, 79, 126, 0.3);
}

.comment-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 79, 126, 0.4);
}

.comments-list {
    max-height: 350px;
    overflow-y: auto;
    padding: 5px 0;
    user-select: text;
    /* To control color of selected text */
}

.comments-list::selection,
.comments-list *::selection {
    background-color: transparent;
    /* Prevent blue highlight on selection */
}

.comment-menu {
    position: absolute;
    right: 0;
    top: 3px;
    /* Moved further up from 8px */
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 130px;
    z-index: 1000;
    overflow: hidden;
}

.comment-item {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    padding: 12px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    animation: fadeIn 0.3s ease;
    position: relative;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.comment-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateX(3px);
}

.comment-author-pic {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.95rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(52, 79, 126, 0.3);
    overflow: hidden;
    position: relative;
}

.comment-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Comment Menu Dropdown */
.comment-menu-dropdown {
    position: relative;
    margin-left: auto;
}

.comment-menu-btn {
    background: none;
    border: none;
    color: #65676b;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.comment-menu-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

.comment-menu {
    position: absolute;
    right: 0;
    top: 8px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 130px;
    z-index: 1000;
    overflow: hidden;
}

.comment-text:hover {
    text-decoration: none;
    color: inherit;
    outline: none;
}

.comment-text:focus {
    outline: none;
}

.comment-menu button {
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: white;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    color: var(--text-color);
    font-size: 0.85rem;
}

.comment-menu button:hover {
    background: #f0f2f5;
}

.comment-menu button:first-child {
    color: var(--primary-color);
}

.comment-menu button:last-child {
    color: #e74c3c;
}

.comment-content {
    flex: 1;
    width: 100%;
}

.comment-author-name {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: var(--text-color);
}

.comment-text {
    font-size: 0.9rem;
    color: var(--text-color);
    margin: 0;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Responsive Design */
@media (max-width: 992px) {
    .feed-container {
        padding: 0 10px;
    }

    .sidebar {
        padding: 0 10px;
    }

    /* Quick Links Sidebar toggle styles for small screens */
    #quickLinksSidebar.d-none {
        display: none !important;
    }

    #quickLinksSidebar.d-block {
        position: fixed !important;
        top: 56px;
        /* height of navbar */
        left: 0;
        height: calc(100vh - 56px);
        width: 250px;
        background-color: #fff;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
        overflow-y: auto;
        z-index: 1050;
        padding: 1rem;
    }

    /* Make sure main container has some left margin when sidebar visible */
    body:not(.quickLinksOpen) #quickLinksSidebar.d-block+.main-container {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 0 5px;
        /* Reduce horizontal padding to avoid horizontal scroll caused by Bootstrap row negative margins */
        overflow-x: hidden;
        /* Prevent horizontal overflow */
    }

    .feed-container {
        padding: 0 5px;
    }

    .post-card {
        margin-bottom: 15px;
    }

    .post-header {
        padding: 12px;
    }

    .post-content {
        padding: 12px;
    }

    .post-actions {
        padding: 8px 12px;
    }

    .post-action-btn {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.1rem;
    }

    .create-post-card .card-body {
        padding: 12px;
    }

    #postText {
        font-size: 0.9rem;
        padding: 8px 12px;
    }

    .post-author-pic {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .post-author-name {
        font-size: 0.9rem;
    }

    .post-time {
        font-size: 0.75rem;
    }

    .comment-item {
        padding: 6px;
    }

    .comment-author-pic {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
}

/* Scrollbar Styling */
.comments-list::-webkit-scrollbar {
    width: 6px;
}

.comments-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.comments-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.comments-list::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* SweetAlert2 Custom Styling */
.swal2-textarea {
    width: 100% !important;
    min-height: 100px !important;
    border-radius: 8px !important;
    border: 2px solid var(--border-color) !important;
    padding: 12px !important;
    font-size: 0.95rem !important;
}

.swal2-textarea:focus {
    border-color: var(--primary-color) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(52, 79, 126, 0.1) !important;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #65676b;
}

.empty-state i {
    font-size: 5rem;
    margin-bottom: 20px;
    opacity: 0.4;
    color: var(--primary-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.4;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.6;
    }
}

.empty-state p {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-color);
}

.t_n {
    text-decoration: none;
}