/* Header (Navbar) Color Reference */
.navbar.navbar-dark,
.navbar.navbar-dark .navbar {
    background-color: #fff !important; /* White background for navbar */
}

.navbar-brand,
.navbar-dark .nav-link {
    color: #1e1222 !important; /* Dark purple text for contrast */
}

.navbar-brand:hover,
.navbar-dark .nav-link:hover {
    color: #2e1a33 !important; /* Slightly lighter purple on hover */
}

.navbar-dark .navbar-collapse {
    background-color: #fff !important; /* White background for mobile menu */
    position: absolute;
    top: 100%; /* Places menu below navbar */
    width: 200px; /* Compact width for menu */
    padding: 0.5rem; /* Padding for menu items */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Shadow for visibility */
    z-index: 1000; /* Ensures menu appears above other content */
    transition: transform 0.3s ease-in-out; /* Smooth transition for collapse */
    /* Align menu with hamburger icon by offsetting from right edge (desktop) */
    right: auto;
    left: calc(100% - 48px); /* Adjust based on hamburger icon width and padding */
    transform: translateX(-100%); /* Shift menu to align its right edge with hamburger */
}

.navbar-dark .navbar-collapse .nav-link {
    color: #1e1222 !important; /* Dark purple text for mobile menu links */
}

.navbar-dark .navbar-collapse .nav-link:hover {
    color: #2e1a33 !important; /* Slightly lighter purple on hover for mobile menu */
}

.navbar-dark .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%231e1222' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important; /* Dark purple toggler icon */
}

/* General Styles */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
}

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

.card-header,
.login-card-header {
    background-color: #fff !important; /* White background */
    color: #1e1222 !important; /* Dark purple text */
    font-weight: bold !important; /* Bold text */
}

.btn-primary {
    background-color: #1e1222 !important; /* Dark purple */
    border-color: #1e1222 !important; /* Ensure border matches */
    color: #fff !important; /* White text for contrast */
}

.btn-primary:hover {
    background-color: #2e1a33 !important; /* Slightly lighter shade of dark purple for hover */
    border-color: #2e1a33 !important;
    color: #fff !important;
}

.btn-primary:focus,
.btn-primary:active {
    background-color: #2e1a33 !important; /* Consistent hover/active state */
    border-color: #2e1a33 !important;
    color: #fff !important;
}

/* Style for icon buttons (Message and Favorite) */
.btn-sm {
    background-color: #1e1222 !important; /* Dark purple */
    border-color: #1e1222 !important;
    color: #fff !important; /* White icon/text for contrast */
}

.btn-sm:hover {
    background-color: #2e1a33 !important; /* Slightly lighter shade of dark purple for hover */
    border-color: #2e1a33 !important;
    color: #fff !important;
}

.btn-sm i {
    font-size: 1rem; /* Adjust icon size */
}

/* Ensure badge contrast */
.badge.bg-primary {
    background-color: #1e1222 !important; /* Dark purple */
    color: #fff !important; /* White text */
}

.badge.bg-light {
    color: #000 !important; /* Black text */
    background-color: #f8f9fa !important; /* Light gray background */
}

.popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.filter-section {
    margin-bottom: 20px;
}

.post-actions {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.credits-badge {
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.btn-outline-success {
    color: #28a745;
    border-color: #28a745;
}

.btn-outline-success:hover {
    color: #fff;
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

/* Style for disabled input fields */
.disabled-grey {
    background-color: #e9ecef !important; /* Grey background */
    color: #6c757d !important; /* Grey text */
    cursor: not-allowed; /* Indicate non-editable */
}

/* Ensure collapsed menu aligns to the right on all screen sizes */
.navbar-collapse {
    position: absolute;
    top: 100%; /* Places menu below navbar */
    width: 200px; /* Compact width for menu */
    padding: 0.5rem; /* Padding for menu items */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Shadow for visibility */
    z-index: 1000; /* Ensures menu appears above other content */
    transition: transform 0.3s ease-in-out; /* Smooth transition for collapse */
    /* Align menu with hamburger icon by offsetting from right edge (desktop) */
    right: auto;
    left: calc(100% - 48px); /* Adjust based on hamburger icon width and padding */
    transform: translateX(-100%); /* Shift menu to align its right edge with hamburger */
}

.navbar-collapse.show {
    display: block; /* Ensure menu is visible when toggled */
}

.navbar-collapse .navbar-nav {
    flex-direction: column; /* Stack links vertically */
    align-items: flex-end; /* Align nav items to the right */
    width: 100%; /* Ensure nav takes full width of container */
}

.navbar-collapse .nav-link {
    text-align: right; /* Right-align text within each link */
    padding: 0.5rem 1rem; /* Compact padding */
    width: 100%; /* Ensure links span the nav width */
    box-sizing: border-box; /* Include padding in width */
}

/* Ensure hamburger icon is styled and functional */
.navbar-dark .navbar-toggler {
    background-color: #fff !important; /* White background for hamburger button */
    border: none;
    padding: 0.25rem 0.5rem;
}

/* Icon Link Styles */
.icon-link {
    font-size: 1.25rem;
    color: #1e1222; /* Dark purple */
    transition: color 0.2s, transform 0.2s;
    text-decoration: none;
}
.icon-link.danger {
    color: #1e1222; /* Dark purple for danger variant */
}
.icon-link:hover {
    color: #2e1a33; /* Slightly lighter purple on hover */
    transform: scale(1.2);
}
.icon-link.danger:hover {
    color: #2e1a33; /* Slightly lighter purple for danger variant on hover */
}

/* Login Page Specific Styles */
.btn.login-btn-primary {
    background-color: #1e1222 !important; /* Dark purple */
    border-color: #1e1222 !important; /* Dark purple border */
    color: #fff !important; /* White text */
}

.btn.login-btn-primary:hover,
.btn.login-btn-primary:focus,
.btn.login-btn-primary:active {
    background-color: #2e1a33 !important; /* Slightly lighter dark purple for hover/active */
    border-color: #2e1a33 !important;
    color: #fff !important;
}

/* Mobile-specific styles for hamburger menu */
@media (max-width: 767.98px) {
    .navbar-dark .navbar-collapse {
        right: 0; /* Flush with right screen edge on mobile */
        left: auto;
        transform: none; /* Remove transform to align with screen edge */
        width: 100%; /* Full width for mobile */
        max-width: 200px; /* Maintain compact width */
        background-color: #fff !important; /* White background */
    }
}