/* Modern Meutch Styling */

/* Root Variables for easy theming */
:root {
    --primary-color: #4fd1c7;        /* Soft teal */
    --primary-dark: #319795;         /* Darker teal */
    --secondary-color: #718096;      /* Muted gray */
    --success-color: #38b2ac;        /* Teal green */
    --warning-color: #f6ad55;        /* Goldenrod */
    --danger-color: #fc8181;         /* Coral */
    --regional-color: #198754;       /* Emerald green (giveaway ribbon, regional badges) */
    --light-bg: #fffffe;             /* Off-white */
    --dark-text: #2d3748;            /* Dark gray */
    --muted-text: #718096;           /* Muted gray */
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --border-radius: 0.5rem;
    --border-radius-sm: 0.25rem;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Base Styles */
body {
    font-family: var(--font-family);
    background-color: var(--light-bg);
    color: var(--dark-text);
    line-height: 1.6;
    padding-top: 70px; /* Account for fixed navbar */
}

/* Custom Bootstrap Variables Override */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
    font-weight: 500;
}

.btn-primary:hover {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    color: white !important;
}

/* Navigation Enhancements */
.navbar {
    backdrop-filter: blur(10px);
    background-color: rgba(248, 250, 252, 0.95) !important;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--dark-text) !important;
}

/* Navbar Logo */
.navbar-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: var(--border-radius-sm);
    transition: transform 0.2s ease;
}

.navbar-brand:hover .navbar-logo {
    transform: scale(1.05);
}

/* Hero Logo (homepage/about page) */
.hero-logo {
    width: 160px;
    height: 160px;
    object-fit: contain;
    margin-bottom: 1rem;
    animation: fadeInDown 0.6s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer Logo */
.footer-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.logo-placeholder {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: var(--border-radius-sm);
    color: white;
}

.nav-link {
    font-weight: 500;
    color: var(--dark-text) !important;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* Main Content */
.main-content {
    padding: 1rem 0;
}

/* Ensure proper navbar spacing */
.navbar.fixed-top {
    height: auto;
    min-height: 60px;
}

/* Fix about page layout issues */
.main-content .container {
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
}

@media (min-width: 768px) {
    .main-content .container {
        max-width: 1140px;
        margin: 0 auto;
    }
}

/* Fix About page excessive whitespace */
.main-content .row:first-child {
    margin-top: 0 !important;
}

.main-content .row:first-child.mb-5 {
    margin-bottom: 2rem !important; /* Reduce from default 3rem */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    overflow: hidden;
    background: white;
    display: flex;
    flex-direction: column;
}

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

.card-img-top {
    height: 200px;
    object-fit: contain;
    background-color: #f8f9fa;
    transition: transform 0.3s ease;
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

.card-body {
    flex: 1;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 0.75rem;
}

.card-text {
    color: var(--muted-text);
    flex: 1;
    margin-bottom: 1rem;
}

.card-footer {
    background: transparent;
    border: none;
    padding: 0 1.25rem 1.25rem;
    margin-top: auto;
}

/* Item Cards Grid */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.item-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    overflow: hidden;
}

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

/* Circle Cards */
.circles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.circle-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.circle-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-left-color: var(--primary-dark);
}

.circle-card h3 {
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.circle-card p {
    color: var(--muted-text);
    margin-bottom: 1rem;
}

.circle-card a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.circle-card a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
    border: none;
    padding: 0.5rem 1rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
    color: white !important;
    border: none !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #2c7a7b) !important;
    transform: translateY(-1px);
    color: white !important;
}

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

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

.btn-outline-secondary {
    border: 2px solid var(--secondary-color, #6c757d) !important;
    color: var(--secondary-color, #6c757d) !important;
    background: transparent !important;
}

.btn-outline-secondary:hover {
    background: var(--secondary-color, #6c757d) !important;
    border-color: var(--secondary-color, #6c757d) !important;
    color: white !important;
}

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

.btn-outline-danger:hover {
    background: var(--danger-color, #dc3545) !important;
    border-color: var(--danger-color, #dc3545) !important;
    color: white !important;
}

.btn-outline-info {
    border: 2px solid #0dcaf0 !important;
    color: #0dcaf0 !important;
    background: transparent !important;
}

.btn-outline-info:hover {
    background: #0dcaf0 !important;
    border-color: #0dcaf0 !important;
    color: #000 !important;
}

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

.btn-outline-success:hover {
    background: var(--success-color, #198754) !important;
    border-color: var(--success-color, #198754) !important;
    color: white !important;
}

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

.btn-outline-warning:hover {
    background: var(--warning-color, #f6ad55) !important;
    border-color: var(--warning-color, #f6ad55) !important;
    color: #000 !important;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: var(--border-radius-sm);
}

.badge.bg-success {
    background-color: var(--success-color) !important;
}

.badge.bg-warning {
    background-color: var(--warning-color) !important;
}

.badge.bg-danger {
    background-color: var(--danger-color) !important;
}

.badge.bg-regional {
    background-color: var(--regional-color) !important;
}

.border-regional {
    border-color: var(--regional-color) !important;
}

.giveaway-ribbon {
    position: absolute;
    top: 1.1rem;
    left: -3.1rem;
    width: 11rem;
    padding: 0.3rem 0;
    background-color: var(--regional-color);
    color: #fff;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    transform: rotate(-45deg);
    z-index: 1;
}

/* Tags and Categories */
.category, .tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    margin: 0.125rem;
    border-radius: 2rem;
    background: var(--light-bg);
    color: var(--muted-text);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

/* Category-specific styling */
.category {
    background: var(--light-bg);
    color: var(--muted-text);
    border-color: var(--border-color);
}

.category:hover {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* Tag-specific styling */
.tag {
    background: rgba(79, 209, 199, 0.1); /* Light teal background using primary color */
    color: var(--primary-dark);
    border-color: var(--primary-color);
}

.tag:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Forms */
.form-control {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: var(--font-family);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

.form-label {
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 0.5rem;
}

/* Mobile-friendly file input */
input[type="file"] {
    padding: 0.75rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

input[type="file"]:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #f0fdfa 0%, #e6fffa 100%);
    transform: translateY(-1px);
}

input[type="file"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(79, 209, 199, 0.15);
}

/* Mobile specific improvements */
@media (max-width: 768px) {
    input[type="file"] {
        padding: 1rem;
        font-size: 1rem;
        min-height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    input[type="file"]::file-selector-button {
        background: var(--primary-color);
        color: white;
        border: none;
        padding: 0.75rem 1.5rem;
        border-radius: var(--border-radius-sm);
        font-weight: 500;
        margin-right: 1rem;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

    input[type="file"]::file-selector-button:hover {
        background: var(--primary-dark);
    }
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background-color: #f0fdfa;
    color: #234e52;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background-color: #fff5f5;
    color: #c53030;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background-color: #fffaf0;
    color: #c05621;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background-color: #f0fdfa;
    color: #2c7a7b;
    border-left: 4px solid var(--primary-color);
}

/* Search Results */
.search-card {
    max-width: none;
    margin: 0;
}

.item-thumbnail {
    height: 180px;
    object-fit: cover;
    width: 100%;
    border-radius: var(--border-radius-sm);
}

/* Profile Images */
.profile-picture-small {
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

/* Sections */
.user-circles, .items-section {
    margin-bottom: 3rem;
}

.user-circles h2, .items-section h2 {
    color: var(--dark-text);
    font-weight: 600;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

/* Footer */
footer {
    background: white !important;
    border-top: 1px solid var(--border-color) !important;
    margin-top: auto;
}

footer h6 {
    color: var(--primary-color) !important;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted-text);
}

.empty-state i {
    font-size: 3rem;
    color: var(--border-color);
    margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem 0;
    }

    h1 {
        font-size: 2rem;
    }

    /* Hero logo smaller on mobile */
    .hero-logo {
        width: 80px;
        height: 80px;
    }

    .items-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .circles-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .circle-card {
        padding: 1rem;
    }

    /* note: .join-request-item is stacked via its inner > .d-flex (below);
       this rule only applies to .circle-member-item, the flex <li> */
    .circle-member-item {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
    }

    .circle-member-item .button-group,
    .join-request-item .button-group {
        width: 100%;
        justify-content: flex-end;
    }

    .circle-member-item .btn-sm,
    .join-request-item .btn-sm {
        padding: 0.5rem 1rem;
    }

    /* Join request items — stack the inner flex container so the name
       doesn't collapse against the action buttons on narrow screens */
    .join-request-item > .d-flex {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* the <a> wraps only the requester name; the message <p> shares the
       member-list-name class and must not be affected */
    .join-request-item a .member-list-name {
        min-width: 80px;
    }
}

@media (max-width: 576px) {
    body {
        padding-top: 70px;
    }

    .navbar-brand {
        font-size: 1.25rem;
    }

    .container {
        padding: 0 1rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus indicators for keyboard navigation */
.btn:focus,
.nav-link:focus,
.form-control:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000;
        --muted-text: #000;
    }
}

/* Print styles */
@media print {
    .navbar,
    footer,
    .btn {
        display: none !important;
    }

    .main-content {
        padding-top: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Optional: Change cursor to pointer for clickable cards */
.item-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.item-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Optional: Ensure images don't have default link styles */
.item-link img {
    display: block; /* Removes bottom margin/padding */
    color: inherit; /* Inherit text color */
}

/* Ensure inner text doesn't get extra styles from <a> */
.item-link .card-title,
.item-link .card-text {
    color: inherit;
}

/* Ensure the 'My Items' edit and delete buttons are styled correctly */
.card-footer a.btn {
    margin-right: 5px;
    text-decoration: none; /* Remove underlines from buttons */
}

/* Optional: Prevent links inside the card footer from affecting the parent link */
.card-footer a,
.card-footer form {
    pointer-events: auto;
}

/* Remove pointer events from the parent link when interacting with footer elements */
.card-footer {
    position: relative;
}

/* Ensure that the footer buttons are clickable without triggering the parent link */
.card-footer a.btn,
.card-footer form {
    position: relative;
    z-index: 2;
}
/* Ensure text colors are readable */
.card-title.text-primary {
    color: #007bff !important;
}

.card-text.text-dark {
    color: #212529 !important;
}

.profile-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #ddd; /* Optional: Add a border for better appearance */
}

.profile-picture-link {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1000; /* Ensures the profile picture stays above other elements */
}

.profile-picture-small {
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff; /* Optional: Adds a white border around the image */
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3); /* Optional: Adds a subtle shadow for depth */
    cursor: pointer;
}

.faq-section {
    margin-top: 20px;
}

.faq-item {
    margin-bottom: 20px;
}

.faq-item h4 {
    color: #0d6efd; /* Bootstrap primary color */
}

.faq-item p {
    margin-left: 20px;
    color: #555;
}

.item-image {
    max-width: 400px; /* Adjust the value as needed */
    width: 100%;
    height: auto;
    object-fit: contain;
    border: 2px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.item-image-placeholder {
    max-width: 400px;
    width: 100%;
    height: 250px;
    border: 2px dashed var(--border-color);
    border-radius: 5px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

/* Item Detail Page Styles */
.item-detail-image-container {
    position: sticky;
    top: 100px;
}

.item-detail-image-inner {
    overflow: hidden;
    border-radius: var(--border-radius);
}

.item-detail-image {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.item-detail-image-placeholder {
    width: 100%;
    height: 400px;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    transition: all 0.3s ease;
}

.item-detail-image-placeholder:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #f0fdfa 0%, #e6fffa 100%);
}

.item-detail-content .card {
    border: none;
    box-shadow: var(--shadow);
    border-radius: var(--border-radius);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.item-detail-content .card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.item-detail-content .card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    border: none;
}

.item-detail-content .card-title {
    color: var(--dark-text);
    font-weight: 700;
    margin-bottom: 0;
}

.item-detail-content .card-header .card-title {
    color: white;
    margin-bottom: 0;
}

/* Owner management tools — consistent button heights */
.item-detail-content .btn-sm {
    min-height: 2.25rem;
    display: inline-flex;
    align-items: center;
}

/* Primary CTA badge vertical centering */
.item-detail-content .btn-lg .badge {
    vertical-align: middle;
    line-height: 1.2;
}

/* Metadata row icons — size to match text cap height, centered in flex row */
.item-detail-content .d-flex.align-items-center > .fas {
    font-size: 1.15em;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .item-detail-image-container {
        position: static;
        margin-bottom: 2rem;
    }

    .item-detail-image {
        max-height: 60vh;
    }

    .item-detail-image-placeholder {
        height: 300px;
    }
}

/* ── Messaging: Inbox List Layout ── */
.conversation-list {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    background: #fff;
    margin-bottom: 2rem;
}

/* ── Conversation Row (vertical stacking, taller rows) ── */
.conversation-row {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.125rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.15s ease;
    text-decoration: none;
    color: inherit;
}

.conversation-row:last-child {
    border-bottom: none;
}

.conversation-row:hover {
    background-color: #f5f7fa;
    text-decoration: none;
    color: inherit;
}

.conversation-row.conversation-unread {
    background-color: #fafdfd;
}

.conversation-row.conversation-unread:hover {
    background-color: #f0f7f7;
}

/* ── Row cells ── */

/* 48×48 checkbox hitbox — wraps the tiny <input> so tapping is easy */
.conversation-row .conv-checkbox-hitbox {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    /* Push the hitbox away from the avatar so they don't overlap */
    margin-right: 0;
    transition: background-color 0.15s ease;
}

.conversation-row .conv-checkbox-hitbox:hover {
    background-color: rgba(0, 0, 0, 0.06);
}

/* The actual checkbox sits in the center of the hitbox */
.conversation-row .conv-checkbox {
    margin: 0;
    z-index: 3;
}

.conversation-row .conv-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
    overflow: hidden;
    margin-top: 0.2rem;
}

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

/* ── Body: vertically stacked name → context tag → preview ── */
.conversation-row .conv-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.conversation-row .conv-name {
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--dark-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
    min-width: 0;
}

.conversation-row.conversation-unread .conv-name {
    font-weight: 600;
    color: #1a202c;
}

.conversation-row .conv-preview {
    color: var(--muted-text);
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.conversation-row.conversation-unread .conv-preview {
    color: #4a5568;
    font-weight: 600;
}

/* ── Meta: fixed-width right-aligned date gutter ── */
.conversation-row .conv-meta {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    min-width: 68px;
    margin-left: auto;
}

.conversation-row .conv-time {
    font-size: 0.8rem;
    color: var(--muted-text);
    white-space: nowrap;
    text-align: right;
}

/* ── Conv-body header: dot + name row ── */
.conversation-row .conv-body__header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

/* ── Unread dot (teal dot, inline before sender name) ── */
.conversation-row .unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #0d9488;
    flex-shrink: 0;
}

/* ── Context Badge (standalone pill tag on its own line) ── */
.context-badge {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.15rem 0.5rem;
    border-radius: 0.3rem;
    white-space: nowrap;
    flex-shrink: 0;
    max-width: fit-content;
    line-height: 1.3;
}

.context-badge--item { background: #e3f2fd; color: #1565c0; }
.context-badge--request { background: #fce4ec; color: #c62828; }
.context-badge--circle { background: #e8f5e9; color: #2e7d32; }

/* ── Inbox Toolbar (consolidated control bar above conversation list) ── */
.inbox-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.25rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}

.inbox-toolbar__select {
    margin-bottom: 0;
    white-space: nowrap;
}

.inbox-toolbar__mark-read {
    white-space: nowrap;
}

.inbox-toolbar__spacer {
    flex: 1;
}

.inbox-toolbar .btn-link {
    font-size: 0.875rem;
    padding: 0;
}

/* ── Bulk Action Bar ── */
.bulk-action-bar {
    position: sticky;
    bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: var(--dark-text);
    color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 100;
}

.bulk-action-bar--visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.bulk-action-bar .btn {
    font-size: 0.875rem;
}

/* ── Sort Dropdown ── */
.sort-dropdown .dropdown-toggle {
    font-size: 0.875rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .conversation-row {
        padding: 0.75rem 0.75rem;
        gap: 0.6rem;
    }

    .conversation-row .conv-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }

    .conversation-row .conv-name {
        font-size: 0.875rem;
    }

    .conversation-row .conv-preview {
        font-size: 0.8rem;
    }

    .conversation-row .conv-meta {
        min-width: 52px;
    }

    .conversation-row .conv-time {
        font-size: 0.75rem;
    }

    .inbox-toolbar {
        gap: 0.5rem;
        padding: 0.4rem 0;\n    }
}

/* ── Messaging Toolbar ── */
.messaging-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.messaging-toolbar .nav-tabs .nav-link {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--muted-text);
    border: none;
}

.messaging-toolbar .nav-tabs .nav-link.active {
    font-weight: 600;
    color: var(--primary-dark);
    background: transparent;
    border-bottom: 2px solid var(--primary-color);
}

.messaging-toolbar .nav-tabs .nav-link:hover:not(.active) {
    color: var(--dark-text);
    border-bottom: 2px solid transparent;
}

.button-group {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Circle member list — prevent long names from pushing action buttons out of view */
.member-list-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Smaller Form Control for Datepickers */
.form-control-small {
    width: 150px;
}

/* Flex Layout for Form Rows */
.form-row {
    display: flex;
    gap: 20px; /* Space between the columns */
    align-items: flex-start; /* Align items to the top */
    margin-bottom: 15px; /* Space below the row */
}

.conversation-summary-card {
    overflow: hidden;
    background: linear-gradient(180deg, #fbfdff 0%, #ffffff 100%);
    border: 1px solid rgba(49, 151, 149, 0.12);
}

.conversation-summary-media {
    display: block;
    height: 100%;
    min-height: 240px;
    background: linear-gradient(135deg, #edfdfd 0%, #f7fafc 100%);
}

.conversation-summary-media img {
    width: 100%;
    height: 100%;
    min-height: 240px;
    object-fit: cover;
}

.conversation-summary-media-placeholder {
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--primary-dark);
}

.conversation-summary-kicker {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-text);
}

.conversation-summary-title {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
}

.conversation-summary-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted-text);
}

.conversation-summary-item-link {
    color: var(--dark-text);
    font-size: 1.1rem;
    font-weight: 600;
}

.conversation-summary-item-link:hover {
    color: var(--primary-dark);
}

.conversation-summary-description {
    color: var(--muted-text);
    font-size: 1.05rem;
}

.conversation-summary-panel {
    padding: 1rem 1.125rem;
    border: 1px solid var(--border-color);
    border-radius: 0.9rem;
    background: #f8fafc;
}

@media (max-width: 767.98px) {
    .conversation-summary-media,
    .conversation-summary-media img,
    .conversation-summary-media-placeholder {
        min-height: 180px;
    }

    .conversation-summary-title {
        font-size: 2.1rem;
    }
}

.message-card {
    max-width: 80%;
    margin-bottom: 1rem;
    transition: transform 0.1s ease-in-out;
}

.message-mine, .message-theirs {
    /* Remove margin-left and margin-right */
    margin-left: 0;
    margin-right: 0;
    max-width: 80%; /* Optional: Adjust the width as needed */
    /* Ensure consistent padding */
    padding: 10px;
    border-radius: 5px; /* Rounded corners for better aesthetics */
}

/* Styles for messages sent by the current user */
.message-mine {
    background-color: #e3f2fd; /* Light blue */
    border-left: 4px solid #1976d2; /* Blue border */
    margin-left: 40px; /* Indent slightly from the left */
}

/* Styles for messages sent by others */
.message-theirs {
    background-color: #f5f5f5; /* Light grey */
    border-left: 4px solid #757575; /* Grey border */
    /* No indentation for others' messages */
}

/* Styles for loan-related messages */
.message-loan {
    border-left: 4px solid #ffc107; /* Amber border */
    background-color: #fff8e1; /* Light amber background */
}

.message-loan .card-header {
    background-color: #fff8e1;
    border-bottom: 1px solid #ffe082;
}

.message-loan .loan-request-details {
    background-color: #fff3cd; /* Light yellow background */
    border: 1px solid #ffeeba;
    padding: 10px;
    border-radius: 5px;
}

/* Optional: Add an icon to loan-related messages */
.message-loan::before {
    content: "📋"; /* Clipboard icon */
    margin-right: 8px;
    font-size: 1.2em;
    /* Ensure the icon doesn't disrupt the layout */
    display: inline-block;
    vertical-align: middle;
}

/* Optional: Different text color for loan-related messages */
.message-loan p {
    color: #856404; /* Dark yellow */
}

/* Timestamp styling */
.message-timestamp {
    font-size: 0.8em;
    color: #666;
}

/* Thread container spacing */
.thread-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0;
}

/* Unread message indicator */
.unread-message {
    border-bottom: 2px solid #dc3545; /* Red bottom border for unread messages */
}

/* Additional styles for better distinction */
.message-loan.message-mine {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    margin-left: 40px; /* Maintain indentation */
}

.message-loan.message-theirs {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
}

/* Optional: Hover effects for loan-related messages */
.message-loan:hover {
    background-color: #ffeeba; /* Slightly darker amber on hover */
}

/* Ensure icons are properly aligned */
.message-loan .card-header::before,
.message-loan .card-body::before {
    content: "";
    display: none; /* Remove if not needed */
}

/* Optional: Improve readability by adding padding */
.message-card .card-body p {
    margin-bottom: 0;
}

/* Optional: Adjust overall message card styles for better appearance */
.message-card {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
}

/* Thumbnail styling */
.thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

/* Table styling */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    color: #212529;
}

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

.table th {
    background-color: #f8f9fa;
}

.table tr:hover {
    background-color: #f1f1f1;
}

/* Button adjustments */
.btn-info {
    background-color: #17a2b8;
    color: white;
    text-decoration: none;
}

.btn-info:hover {
    background-color: #138496;
    color: white;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
}

/* Drag and Drop Upload Zones */
.drag-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    background-color: #fafafa;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 1rem;
}

.drag-drop-zone:hover {
    border-color: var(--primary-color);
    background-color: #f0fdfa;
}

.drag-drop-zone.drag-over {
    border-color: var(--primary-color);
    background-color: #e6fffa;
    border-style: solid;
    transform: scale(1.02);
}

.drag-drop-zone.has-file {
    border-color: var(--success-color);
    background-color: #f0fdf4;
}

.drag-drop-content {
    pointer-events: none;
}

.drag-drop-content .fa-cloud-upload-alt {
    color: var(--muted-text);
    transition: color 0.3s ease;
}

.drag-drop-zone:hover .fa-cloud-upload-alt,
.drag-drop-zone.drag-over .fa-cloud-upload-alt {
    color: var(--primary-color);
}

.drag-drop-zone.has-file .fa-cloud-upload-alt {
    color: var(--success-color);
}

.drag-drop-zone .browse-btn {
    pointer-events: all;
    cursor: pointer;
}

.drag-drop-zone .file-info {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Mobile/Touch Device Optimization */
/* Hide drag-and-drop specific UI on touch devices where drag-and-drop isn't supported */
@media (hover: none) and (pointer: coarse) {
    /* Simplify the drop zone for mobile - remove drag language */
    .drag-drop-zone .drag-drop-content > p:first-of-type,
    .drag-drop-zone .drag-drop-content > p:nth-of-type(2) {
        display: none;
    }

    /* Make the icon smaller and adjust spacing */
    .drag-drop-content .fa-cloud-upload-alt {
        font-size: 2rem !important;
        margin-bottom: 0.5rem !important;
    }

    /* Reduce padding on mobile */
    .drag-drop-zone {
        padding: 1.5rem 1rem;
    }

    /* Disable hover effects on touch devices */
    .drag-drop-zone:hover {
        border-color: var(--border-color);
        background-color: #fafafa;
    }

    .drag-drop-zone:hover .fa-cloud-upload-alt {
        color: var(--muted-text);
    }
}

/* Photo Preview - Cropper.js Customization */
/* Node sizes and symmetry - 30px circular handles with perfect centering */
.cropper-point {
    width: 30px !important;
    height: 30px !important;
    background-color: var(--primary-color) !important;
    opacity: 0.9 !important;
    border-radius: 50% !important;
    transition: all 0.2s ease;
    z-index: 10;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
}

/* Bulletproof positioning using top/left percentages and translate */
.cropper-point.point-e {
    top: 50% !important;
    left: 100% !important;
    right: auto !important;
}

.cropper-point.point-n {
    top: 0 !important;
    left: 50% !important;
}

.cropper-point.point-w {
    top: 50% !important;
    left: 0 !important;
}

.cropper-point.point-s {
    top: 100% !important;
    left: 50% !important;
    bottom: auto !important;
}

.cropper-point.point-ne {
    top: 0 !important;
    left: 100% !important;
    right: auto !important;
}

.cropper-point.point-nw {
    top: 0 !important;
    left: 0 !important;
}

.cropper-point.point-sw {
    top: 100% !important;
    left: 0 !important;
    bottom: auto !important;
}

.cropper-point.point-se {
    top: 100% !important;
    left: 100% !important;
    right: auto !important;
    bottom: auto !important;
}

/* Hover */
.cropper-point:hover {
    transform: translate(-50%, -50%) scale(1.1) !important;
}

/* Cleanup */
.cropper-point::before {
    display: none !important;
}

/* ============================================
   Requests Feed — Social-media-style cards
   ============================================ */

.request-card {
    background: #fff;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: box-shadow 0.15s ease-in-out;
}

.request-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.request-card-fulfilled {
    opacity: 0.65;
    background: #f8f9fa;
}

.request-card-expired {
    opacity: 0.55;
    background: #f8f9fa;
}

.giveaway-card-claimed {
    opacity: 0.65;
    background: #f8f9fa;
}

.request-avatar img {
    object-fit: cover;
    border: 2px solid var(--border-color, #dee2e6);
}

/* ===========================================
   Share Preview Pages & Share Button
   =========================================== */

/* Dark hero background for the share card area — mirrors the landing page hero */
.share-preview-hero {
    background: linear-gradient(150deg, #155e5c 0%, #1e7874 45%, #2a9490 100%);
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}

.share-preview-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.25);
    pointer-events: none;
}

@media (max-width: 768px) {
    .share-preview-hero {
        padding: 100px 0 60px;
        background: linear-gradient(160deg, #1e8480 0%, #2aadaa 100%);
    }
}

.share-preview-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

.share-preview-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    background-color: #f8f9fa;
    padding: 12px;
    box-sizing: border-box;
}

.share-preview-image-placeholder {
    height: 250px;
    border-bottom: 1px solid var(--border-color, #dee2e6);
    padding: 12px;
}

.share-member-avatar img {
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.share-btn {
    white-space: nowrap;
    flex-shrink: 0;
}

.circle-result-rail {
    width: 72px;
    min-width: 72px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.circle-result-thumbnail {
    width: 64px;
    height: 64px;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color, #dee2e6);
}

.circle-result-thumbnail-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 0.5rem;
    background: var(--bs-light);
    border: 1px solid var(--bs-border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-secondary-color);
}

.circle-result-content {
    min-width: 0;
}

.circle-result-title {
    margin-bottom: 0.25rem;
}

@media (max-width: 575.98px) {
    .circle-result-row {
        gap: 0.75rem;
    }

    .circle-result-rail {
        width: 56px;
        min-width: 56px;
    }

    .circle-result-thumbnail {
        width: 48px;
        height: 48px;
    }

    .circle-result-thumbnail-placeholder {
        width: 48px;
        height: 48px;
    }

    .circle-result-actions {
        width: 100%;
    }

    .circle-result-actions .btn {
        width: 100%;
    }
}

@media (min-width: 576px) {
    .circle-result-actions {
        width: auto;
    }
}

/* ===========================================
   Homepage Activity Feed (rounded app style)
   =========================================== */

.activity-feed-page {
    max-width: 980px;
    margin: 0 auto;
}

.activity-feed-header {
    background: white;
    border-radius: calc(var(--border-radius) * 2.5);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.activity-feed-cta {
    border-radius: 9999px !important;
    padding: 0.6rem 1.1rem;
}

.activity-feed-list {
    margin-top: 1rem;
}

.activity-feed-filters {
    border-radius: calc(var(--border-radius) * 2);
    border: 1px solid var(--border-color);
}

.activity-feed-filters .card-body {
    padding: 1rem 1.25rem;
}

.activity-feed-card {
    border-radius: calc(var(--border-radius) * 2.25) !important;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.activity-feed-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow) !important;
}

.activity-feed-card .card-body {
    padding: 1.2rem 1.3rem;
}

.activity-feed-page .activity-feed-actor-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.2rem 0.55rem 0.2rem 0.2rem;
    border-radius: 9999px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
}

.activity-feed-page .activity-feed-avatar-fallback {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--primary-dark);
    background: rgba(79, 209, 199, 0.15);
}

.activity-feed-page .activity-feed-actor-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--dark-text);
}

.activity-feed-page .activity-feed-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.activity-feed-page .activity-feed-meta-separator {
    opacity: 0.6;
}

.activity-feed-badge {
    border-radius: 9999px;
    padding: 0.35rem 0.7rem;
}

.activity-feed-link {
    border-radius: 9999px !important;
}

.activity-feed-actor-link:hover,
.activity-feed-actor-link:focus-visible {
    text-decoration: underline !important;
}

@media (max-width: 767.98px) {
    .activity-feed-header {
        border-radius: calc(var(--border-radius) * 2);
        padding: 1rem;
    }

    .activity-feed-card {
        border-radius: calc(var(--border-radius) * 1.75) !important;
    }
}

/* Meutch orange — matches the logo background (#f6ad55) */
.btn-meutch-orange {
    background-color: var(--warning-color) !important;
    border-color: var(--warning-color) !important;
    color: white !important;
    font-weight: 500;
}

.btn-meutch-orange:hover,
.btn-meutch-orange:focus {
    background-color: #e09333 !important;
    border-color: #e09333 !important;
    color: white !important;
}

/* Mobile speed-dial FAB */
.fab-speed-dial {
    position: fixed;
    bottom: calc(1.5rem + env(safe-area-inset-bottom));
    right: 1.25rem;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.65rem;
}

.fab-main {
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 9999px;
    background-color: var(--warning-color) !important;
    border-color: var(--warning-color) !important;
    color: white !important;
    font-size: 1.3rem;
    box-shadow: 0 8px 18px rgb(0 0 0 / 0.28);
    transition: transform 0.2s ease, background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    animation: fab-attention 1.2s ease-in-out 0.5s 2;
}

.fab-main:hover,
.fab-main:focus {
    background-color: #e09333 !important;
    border-color: #e09333 !important;
    color: white !important;
    transform: scale(1.07);
}

.fab-main .fab-icon {
    transition: transform 0.25s ease;
}

.fab-main.is-open .fab-icon {
    transform: rotate(45deg);
}

.fab-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.25s ease, opacity 0.2s ease;
}

.fab-actions.is-open {
    max-height: 12rem;
    opacity: 1;
    pointer-events: auto;
}

.fab-label {
    background-color: #0f172a;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.35rem 0.6rem;
    border-radius: 9999px;
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.22);
    pointer-events: none;
}

.fab-action {
    background-color: var(--warning-color) !important;
    border-color: var(--warning-color) !important;
    color: white !important;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.15);
}

.fab-action:hover,
.fab-action:focus {
    background-color: #e09333 !important;
    border-color: #e09333 !important;
    color: white !important;
}

@keyframes fab-attention {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

@media (prefers-reduced-motion: reduce) {
    .fab-main {
        animation: none;
    }
}

/* Feed-type filter pills — completely self-contained to avoid btn-outline-primary conflicts */
.feed-type-pill {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--muted-text);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.feed-type-pill:hover,
.feed-type-pill:focus {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: var(--dark-text);
}

/* Checked states per type */
.btn-check:checked + .feed-type-pill--requests {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-check:checked + .feed-type-pill--giveaways {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.btn-check:checked + .feed-type-pill--circle-joins {
    background: #0dcaf0;
    border-color: #0dcaf0;
    color: white;
}

.btn-check:checked + .feed-type-pill--loans {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

/* ===================================================================
   Landing Page  (anonymous homepage)
   =================================================================== */

html {
    overflow-x: hidden;
}

.landing-page {
    padding-top: 0;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* --- transparent → solid navbar transition --- */
.landing-page .navbar {
    background-color: rgba(12, 50, 49, 0.5) !important;
    backdrop-filter: blur(6px);
    box-shadow: none !important;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

.landing-page .navbar.scrolled {
    background-color: rgba(248, 250, 252, 0.97) !important;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm) !important;
}

.landing-page .navbar:not(.scrolled) .navbar-brand span,
.landing-page .navbar:not(.scrolled) .nav-link {
    color: rgba(255, 255, 255, 0.92) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.landing-page .navbar:not(.scrolled) .nav-link:hover {
    color: #fff !important;
}

.landing-page .navbar:not(.scrolled) .btn-primary,
.landing-page .navbar:not(.scrolled) .nav-register {
    background-color: #fff !important;
    border-color: #fff !important;
    color: var(--primary-dark) !important;
}

.landing-page .navbar:not(.scrolled) .btn-primary:hover,
.landing-page .navbar:not(.scrolled) .nav-register:hover {
    background-color: rgba(255, 255, 255, 0.85) !important;
}

/* Register pill button in navbar (desktop, scrolled / non-landing pages) */
@media (min-width: 992px) {
    .nav-register {
        border: 1.5px solid var(--primary-color) !important;
        border-radius: 50px !important;
        padding: 0.3rem 1rem !important;
        color: var(--primary-color) !important;
        font-weight: 600 !important;
        transition: background-color 0.2s ease, color 0.2s ease;
    }
    .nav-register:hover {
        background-color: var(--primary-color) !important;
        color: #fff !important;
    }
}

/* Landing page navbar: no hamburger
   - Mobile: brand + pre-toggler Login only (Register is the hero CTA)
   - Desktop lg+: brand + Login + Register pill
*/
.landing-page .navbar-toggler,
.landing-page .navbar-mobile-login { /* already hidden here; shown outside collapse */
}

.landing-page .navbar-toggler {
    display: none !important;
}

/* Mobile: hide the entire collapse — keep it simple */
@media (max-width: 991.98px) {
    .landing-page .navbar-collapse {
        display: none !important;
    }
}

/* Desktop lg+: force collapse open, hide left nav (redundant on landing page) */
@media (min-width: 992px) {
    .landing-page .navbar-collapse {
        display: flex !important;
        flex-basis: auto;
        flex-grow: 1;
        align-items: center;
    }
    .landing-page .navbar-nav.me-auto {
        display: none !important;
    }
    .landing-page .navbar-collapse .navbar-nav {
        margin-left: auto;
    }
}

/* --------- */
.landing-hero {
    min-height: 100vh;
    background: linear-gradient(150deg, #155e5c 0%, #1e7874 45%, #2a9490 100%);
    color: #fff;
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}

.landing-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.25);
    pointer-events: none;
}

.landing-hero-logo {
    width: 260px;
    height: 260px;
    object-fit: contain;
    opacity: 0.92;
    filter: drop-shadow(0 8px 24px rgba(0,0,0,0.4));
}

.landing-headline {
    font-size: clamp(1.85rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.15;
    max-width: 620px;
    color: #ffffff;
    /* Override the global h1 gradient-clip that makes text transparent on teal bg */
    background: none !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    -webkit-text-fill-color: #ffffff !important;
    letter-spacing: -0.01em;
}

.landing-subheadline {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: rgba(255, 255, 255, 0.85);
    max-width: 480px;
}

.landing-btn-primary {
    background-color: #fff !important;
    border-color: #fff !important;
    color: var(--primary-dark) !important;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.landing-btn-primary:hover {
    background-color: rgba(255, 255, 255, 0.9) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.landing-btn-outline {
    background-color: transparent !important;
    border: 2px solid rgba(255, 255, 255, 0.7) !important;
    color: #fff !important;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.landing-btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-color: #fff !important;
    color: #fff !important;
}

/* --- Sections --- */
.landing-section {
    padding: 5rem 0;
}

.landing-section-alt {
    background-color: #f7fafc;
}

.landing-section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-text);
}

/* --- How-It-Works steps --- */
.landing-step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

/* --- Why Meutch icon circles --- */
.landing-icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(79,209,199,0.15), rgba(49,151,149,0.15));
    color: var(--primary-dark);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* --- Mock feed --- */
.landing-mock-feed {
    background: var(--light-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.landing-avatar-mock {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--dark-text);
    flex-shrink: 0;
}

/* --- Quote / image section --- */
.landing-quote p.h4 {
    color: var(--dark-text);
    font-weight: 600;
    line-height: 1.4;
}

/* --- Final CTA --- */
.landing-cta {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    padding: 5rem 0;
}

.landing-cta p {
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 500;
}

.landing-btn-cta {
    background-color: #fff !important;
    border-color: #fff !important;
    color: var(--primary-dark) !important;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-size: 1.1rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.landing-btn-cta:hover {
    background-color: rgba(255, 255, 255, 0.9) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .landing-hero {
        min-height: auto;
        padding: 100px 0 60px;
        background: linear-gradient(160deg, #1e8480 0%, #2aadaa 100%);
    }

    .landing-hero::before {
        background: rgba(0, 0, 0, 0.1);
    }

    .landing-section {
        padding: 3rem 0;
    }

    .landing-cta {
        padding: 3rem 0;
    }
}

/* ===========================
   Multi-Image Upload Grid
   =========================== */

.multi-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.multi-image-grid.drag-over {
    outline: 2px dashed var(--primary-color);
    outline-offset: 4px;
    border-radius: var(--border-radius);
}

.multi-image-grid.drag-over .multi-image-add-btn {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: #e6fffa;
}

.multi-image-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 2px solid var(--border-color);
    background-color: #f8f9fa;
    cursor: grab;
    transition: border-color 0.2s, transform 0.2s, opacity 0.2s;
}

.multi-image-thumb:hover {
    border-color: var(--primary-color);
}

.multi-image-thumb.dragging {
    opacity: 0.4;
    transform: scale(0.95);
}

body.multi-image-reordering,
body.multi-image-reordering * {
    user-select: none;
}

.multi-image-thumb.drop-before {
    box-shadow: -4px 0 0 0 var(--primary-color);
}

.multi-image-thumb.drop-after {
    box-shadow: 4px 0 0 0 var(--primary-color);
}

.multi-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.multi-image-thumb-overlay {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.multi-image-thumb:hover .multi-image-thumb-overlay {
    opacity: 1;
}

.btn-thumb-action {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-thumb-crop {
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
}

.btn-thumb-crop:hover {
    background-color: #fff;
}

.btn-thumb-delete {
    background-color: rgba(220, 53, 69, 0.85);
    color: #fff;
}

.btn-thumb-delete:hover {
    background-color: rgba(220, 53, 69, 1);
}

.multi-image-thumb-badge {
    position: absolute;
    bottom: 0.25rem;
    right: 0.25rem;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.65rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.multi-image-add-btn {
    aspect-ratio: 1;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--muted-text);
    background-color: #fafafa;
    transition: all 0.2s;
    gap: 0.25rem;
    min-height: 120px;
}

.multi-image-add-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: #f0fdfa;
}

.multi-image-add-btn span {
    font-size: 0.85rem;
    font-weight: 500;
}

.multi-image-add-btn .image-counter {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.7;
}

/* Touch device: always show overlay */
@media (hover: none) and (pointer: coarse) {
    .multi-image-thumb-overlay {
        opacity: 1;
    }
    .multi-image-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.5rem;
    }
}

/* ===========================
   Item Detail Carousel
   =========================== */

#itemImageCarousel .carousel-inner {
    border-radius: var(--border-radius);
    overflow: hidden;
    height: 500px;
}

#itemImageCarousel .carousel-item {
    height: 100%;
}

#itemImageCarousel .carousel-item img {
    height: 100%;
    width: 100%;
    object-fit: contain;
    background-color: #f8f9fa;
}

#itemImageCarousel .carousel-control-prev,
#itemImageCarousel .carousel-control-next {
    width: 10%;
    opacity: 1;
    transition: opacity 0.2s;
}

#itemImageCarousel .carousel-control-prev-icon,
#itemImageCarousel .carousel-control-next-icon {
    background-color: rgba(0, 0, 0, 0.45);
    border-radius: 50%;
    padding: 1.1rem;
    background-size: 50% 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    transition: background-color 0.2s;
}

#itemImageCarousel .carousel-control-prev:hover .carousel-control-prev-icon,
#itemImageCarousel .carousel-control-next:hover .carousel-control-next-icon {
    background-color: rgba(0, 0, 0, 0.65);
}

#itemImageCarousel .carousel-control-prev:focus .carousel-control-prev-icon,
#itemImageCarousel .carousel-control-next:focus .carousel-control-next-icon {
    background-color: rgba(0, 0, 0, 0.65);
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

#itemImageCarousel .carousel-indicators {
    margin-bottom: 0.5rem;
}

#itemImageCarousel .carousel-indicators button {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.item-thumbnail.active,
.item-thumbnail:hover {
    opacity: 1 !important;
    border-color: var(--bs-primary, #0d6efd) !important;
}

/* Mobile carousel adjustments */
@media (max-width: 768px) {
    #itemImageCarousel .carousel-inner {
        height: 60vw;
        max-height: 60vh;
    }

    #itemImageCarousel .carousel-control-prev-icon,
    #itemImageCarousel .carousel-control-next-icon {
        padding: 0.85rem;
    }
}

/* ===========================
   Crop Modal
   =========================== */

#cropModal .crop-container {
    background-color: #f0f0f0;
    border-radius: var(--border-radius);
}

#cropModal .modal-footer {
    flex-wrap: wrap;
}

/* Multi-image live region (screen reader) */
.multi-image-sr-live {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
