/* /home/wal/python/mywal-bober/darkovnik/static/darkovnik/css/custom.css */

/* ==========================================================================
   1. Global Utilities
   ========================================================================== */
.view-hidden {
    display: none !important;
}

/* --- Global Aesthetic Refresh --- */

/* 1. Background Gradients */
[data-bs-theme="light"] body {
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    background-attachment: fixed;
}

[data-bs-theme="dark"] body {
    background: linear-gradient(135deg, #1e2024 0%, #121416 100%);
    background-attachment: fixed;
}

/* 2. Soft Cards & Modals */
.card, .modal-content {
    border: none !important;
    border-radius: 1.25rem !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05) !important;
}

[data-bs-theme="dark"] .card, 
[data-bs-theme="dark"] .modal-content {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25) !important;
}

/* 3. Pill Buttons Globally */
.btn:not(.btn-close):not(.navbar-toggler):not(.dropdown-toggle):not(.link-btn):not(.input-group .btn):not(.input-group > .btn):not(.btn-group > .btn) {
    border-radius: 50rem !important;
}

/* Fix button groups so pills don't break them */
.btn-group > .btn {
    border-radius: 0 !important;
}
.btn-group > .btn:first-child {
    border-top-left-radius: 50rem !important;
    border-bottom-left-radius: 50rem !important;
}
.btn-group > .btn:last-child {
    border-top-right-radius: 50rem !important;
    border-bottom-right-radius: 50rem !important;
}

/* Fix input groups so buttons, texts and 1rem inputs connect seamlessly */
.input-group {
    border-radius: 1rem;
    align-items: stretch;
}

/* Inputs & selects inside input-group */
.input-group > .form-control,
.input-group > .form-select {
    min-height: 48px;
}
.input-group > .form-control:first-child,
.input-group > .form-select:first-child {
    border-top-left-radius: 1rem !important;
    border-bottom-left-radius: 1rem !important;
}
.input-group > .form-control:not(:first-child),
.input-group > .form-select:not(:first-child) {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}
.input-group > .form-control:not(:last-child),
.input-group > .form-select:not(:last-child) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* Buttons inside input-group */
.input-group > .btn,
.input-group > .btn:not(.btn-close):not(.navbar-toggler):not(.dropdown-toggle) {
    border-radius: 0 !important;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.25rem;
    z-index: 2;
}

.input-group > .btn:first-child,
.input-group > .btn:first-child:not(.btn-close):not(.navbar-toggler):not(.dropdown-toggle) {
    border-top-left-radius: 1rem !important;
    border-bottom-left-radius: 1rem !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.input-group > .btn:last-child,
.input-group > .btn:last-child:not(.btn-close):not(.navbar-toggler):not(.dropdown-toggle),
.input-group > .btn:nth-last-child(2):has(+ .invalid-feedback),
.input-group > .btn:nth-last-child(2):has(+ .valid-feedback) {
    border-top-right-radius: 1rem !important;
    border-bottom-right-radius: 1rem !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.input-group > .btn:not(:first-child):not(:last-child) {
    border-radius: 0 !important;
}

/* Small and large button size overrides inside input-group */
.input-group-sm > .btn,
.input-group > .btn.btn-sm {
    min-height: 38px;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}
.input-group-lg > .btn,
.input-group > .btn.btn-lg {
    min-height: 56px;
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
}

/* Input group text addons */
.input-group > .input-group-text {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-color: var(--bs-border-color);
}
.input-group > .input-group-text:first-child {
    border-top-left-radius: 1rem !important;
    border-bottom-left-radius: 1rem !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}
.input-group > .input-group-text:last-child {
    border-top-right-radius: 1rem !important;
    border-bottom-right-radius: 1rem !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}
.input-group > .input-group-text:not(:first-child):not(:last-child) {
    border-radius: 0 !important;
}

/* Exception for explicit rounded pills (like search pill) */
.input-group > .rounded-start-pill {
    border-top-left-radius: 50rem !important;
    border-bottom-left-radius: 50rem !important;
}
.input-group > .rounded-end-pill {
    border-top-right-radius: 50rem !important;
    border-bottom-right-radius: 50rem !important;
}

/* 4. Forms */
.form-control, .form-select {
    border-radius: 1rem;
    padding: 0.75rem 1.25rem;
    border-color: var(--bs-border-color-translucent);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}
.form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.15);
}

/* 5. Segmented Controls (Filtering Pills) */
.segmented-control {
    display: inline-flex;
    background-color: var(--bs-tertiary-bg);
    border-radius: 50rem;
    padding: 0.25rem;
    gap: 0.25rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}
.segmented-control .btn {
    border-radius: 50rem !important;
    border: none !important;
    font-weight: 500;
    transition: all 0.2s ease;
    background-color: transparent;
    color: var(--bs-secondary-color);
}
.segmented-control .btn:hover {
    background-color: rgba(0,0,0,0.05);
}
[data-bs-theme="dark"] .segmented-control .btn:hover {
    background-color: rgba(255,255,255,0.05);
}
.segmented-control .btn.active, 
.segmented-control .btn-success,
.segmented-control .btn-secondary:not(.btn-outline-secondary) {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}
[data-bs-theme="dark"] .segmented-control .btn.active,
[data-bs-theme="dark"] .segmented-control .btn-secondary:not(.btn-outline-secondary) {
    box-shadow: 0 2px 8px rgba(0,0,0,0.4) !important;
}
.segmented-control .btn-star-filter.active i {
    color: #ffc107 !important;
    filter: drop-shadow(0 1px 2px rgba(255, 193, 7, 0.4));
}

/* 6. Condensed Item Rows Alignment */
.list-group.sortable-item-list {
    background: transparent;
    border: none;
    gap: 0.5rem;
}
.list-group-item.condensed-item-row {
    border: none !important;
    border-radius: 1rem !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.04) !important;
    margin-bottom: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
[data-bs-theme="dark"] .list-group-item.condensed-item-row {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2) !important;
}
.list-group-item.condensed-item-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08) !important;
}
[data-bs-theme="dark"] .list-group-item.condensed-item-row:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3) !important;
}

/* ==========================================================================
     2. Typography & Text Elements
     ========================================================================== */

/* --- Text Truncation for Item Descriptions --- */
.description-content {
    position: relative;
    transition: max-height 0.35s ease-in-out;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.description-content.truncated {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.description-content.truncated::after {
    display: none;
}

.description-content.expanded {
    display: block;
}

/* ==========================================================================
     3. Navigation (Navbar, Menus)
     ========================================================================== */

/* --- Navbar Height Consistency (Mobile only now) --- */
.navbar.sticky-top {
    box-shadow: none !important;
}

/* --- Sidebar Navigation Styles --- */
.sidebar-nav {
    width: 280px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: width 0.3s ease;
    z-index: 1030;
}

/* Custom Scrollbar for Sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background-color: var(--bs-border-color);
    border-radius: 10px;
}
.sidebar-nav:hover::-webkit-scrollbar-thumb {
    background-color: var(--bs-secondary);
}

.sidebar-nav .nav-link {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.sidebar-nav .nav-link:hover:not(.active) {
    background-color: var(--bs-secondary-bg);
    transform: translateX(2px);
}

.hover-bg-subtle:hover {
    background-color: var(--bs-secondary-bg);
}

.user-dock {
    transition: background-color 0.15s ease-in-out;
}

.user-dock:hover {
    background-color: var(--bs-secondary-bg);
}

.user-dock-logout {
    width: 34px;
    height: 34px;
    transition: all 0.15s ease-in-out;
    text-decoration: none;
}

.user-dock-logout:hover {
    background-color: var(--bs-tertiary-bg);
}

.user-dock-logout:hover i {
    color: var(--bs-danger) !important;
}

/* Fix mobile menu offcanvas width */
.offcanvas-end {
    max-width: 85%;
}

/* ==========================================================================
     4. Avatars & Images (General image styling, previews, clickable images)
     ========================================================================== */

.add-member-avatar {
    width: 40px;
    height: 40px;
    object-fit: cover;
    flex-shrink: 0;
}

/* --- Avatar Stack (Wishlist Owners & Co-owners) --- */
.avatar-stack {
    display: inline-flex;
    align-items: center;
}
.avatar-stack .avatar-stack-item {
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bs-body-bg);
    position: relative;
    transition: transform 0.15s ease-in-out, z-index 0.15s ease-in-out;
}
.avatar-stack .avatar-stack-item:not(:first-child) {
    margin-left: -10px;
}
.avatar-stack .avatar-stack-item:hover {
    transform: scale(1.15);
    z-index: 5;
}

/* --- Standardized Avatar Sizing System --- */
.avatar {
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}
.avatar-xs { width: 24px; height: 24px; }
.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 40px; height: 40px; }
.avatar-lg { width: 56px; height: 56px; }
.avatar-xl { width: 80px; height: 80px; }

/* --- Standardized Empty State Component --- */
.empty-state-container {
    padding: 3rem 1.5rem;
    text-align: center;
}
.empty-state-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
    font-size: 2rem;
    margin-bottom: 1.25rem;
}

/* --- Styleguide / Component Showcase Utilities --- */
.component-demo-box {
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color-translucent);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.code-preview-block {
    background-color: var(--bs-tertiary-bg);
    border-radius: 0.75rem;
    padding: 1rem;
    font-family: var(--bs-font-monospace);
    font-size: 0.85rem;
    overflow-x: auto;
}

/* --- Image Containers & Previews --- */
.item-list-image-container {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
}
.item-list-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
}
.image-preview-thumbnail {
    max-height: 100px;
    max-width: 150px;
}
.profile-avatar-preview {
    max-height: 100px;
    max-width: 100%;
    object-fit: cover;
}
.received-gift-image-container {
    max-width: 80px;
}

/* --- Clickable Image Styling --- */
.item-image-clickable {
    cursor: pointer;
}

/* --- Floating Action Button (FAB) --- */
.fab-add-item {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1040;
    border: none;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.fab-add-item:hover {
    transform: scale(1.1);
}

@media (max-width: 767.98px) {
    .fab-add-item {
        display: flex;
        bottom: 1.5rem;
        right: 1.5rem;
        width: 50px;
        height: 50px;
    }
    
    .fab-add-item .bi {
        font-size: 1.5rem !important;
    }
}

/* ==========================================================================
     5. Forms & Input Elements
     ========================================================================== */
.form-control-sm-min-height {
    min-height: calc(1.5em + 0.5rem + 2px);
}
.checkbox-list-scrollable {
    max-height: 200px;
    overflow-y: auto;
}
.checkbox-list-scrollable-lg {
    max-height: 300px;
    overflow-y: auto;
}
.metadata-loading-indicator .spinner-border-sm {
    vertical-align: text-bottom;
}
.form-switch-lg,
.form-switch.form-switch-lg {
    padding-left: 3.5rem;
    min-height: 1.8rem;
    width: auto !important;
}
.form-switch-lg .form-check-input,
.form-switch.form-switch-lg .form-check-input {
    width: 3rem !important;
    height: 1.5rem !important;
    cursor: pointer;
}
.form-switch-lg:not(.ps-0) .form-check-input,
.form-switch.form-switch-lg:not(.ps-0) .form-check-input {
    margin-left: -3.5rem !important;
}
.form-switch-lg .form-check-label,
.form-switch.form-switch-lg .form-check-label {
    padding-top: 0.15rem;
    cursor: pointer;
}

/* --- Select2 Customizations --- */
.select2-selection__clear {
    margin-right: 1rem;
}

/* ==========================================================================
     6. Cards & Item Display (Item cards, list rows, specific item features)
     ========================================================================== */

/* --- Claimed Item Highlighting (#73) --- */
.item-card-claimed-by-me {
    border-color: var(--bs-success) !important;
    background-color: rgba(var(--bs-success-rgb), 0.06);
}

[data-bs-theme="dark"] .item-card-claimed-by-me {
    background-color: rgba(var(--bs-success-rgb), 0.12);
}

.item-card-claimed-by-other {
    opacity: 0.78;
    background-color: rgba(var(--bs-warning-rgb), 0.06);
    border-color: rgba(var(--bs-warning-rgb), 0.4) !important;
    transition: opacity 0.2s ease-in-out, background-color 0.2s ease-in-out;
}

[data-bs-theme="dark"] .item-card-claimed-by-other {
    background-color: rgba(var(--bs-warning-rgb), 0.10);
    border-color: rgba(var(--bs-warning-rgb), 0.35) !important;
}

.item-card-claimed-by-other:hover {
    opacity: 0.95;
    background-color: rgba(var(--bs-warning-rgb), 0.09);
}

[data-bs-theme="dark"] .item-card-claimed-by-other:hover {
    background-color: rgba(var(--bs-warning-rgb), 0.14);
}

/* --- Deep Linking Target Pulse Highlight (#72) --- */
@keyframes itemHighlightPulse {
    0% { box-shadow: 0 0 0 0 rgba(var(--bs-primary-rgb), 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(var(--bs-primary-rgb), 0.25); }
    100% { box-shadow: 0 0 0 0 rgba(var(--bs-primary-rgb), 0); }
}

.item-target-highlight {
    animation: itemHighlightPulse 2s ease-in-out;
}

/* --- Birthday Calendar Highlight (#66) --- */
.birthday-today-row {
    background-color: rgba(var(--bs-primary-rgb), 0.08) !important;
}

[data-bs-theme="dark"] .birthday-today-row {
    background-color: rgba(var(--bs-primary-rgb), 0.14) !important;
}

/* ==========================================================================
     7. Mobile UI/UX Enhancements
     ========================================================================== */

/* --- Item Detail Modal Buttons (Mobile) --- */
@media (max-width: 767.98px) {
    #itemDetailModal .modal-body .btn {
        padding-top: 0.6rem !important;
        padding-bottom: 0.6rem !important;
        min-width: 44px;
        text-align: center;
    }

    #itemDetailModal .modal-body form {
        display: flex;
        flex: 1 1 auto;
        min-width: 44px;
    }

    #itemDetailModal .modal-body form .btn {
        width: 100%;
    }
}

/* --- Lists Spacing --- */
.list-group[id^="list-view-items-"] > .list-group-item {
    margin-bottom: 0.5rem;
    border-radius: var(--bs-list-group-border-radius) !important;
}

.list-group[id^="list-view-items-"] > .list-group-item:not(:first-child) {
    border-top-width: var(--bs-list-group-border-width);
}

.list-group[id^="list-view-items-"] > .list-group-item:last-child {
    margin-bottom: 0;
}

.list-group[id^="condensed-view-items-"] > .list-group-item.condensed-item-row {
    margin-bottom: 0.25rem;
    border-radius: var(--bs-list-group-border-radius) !important;
}

.list-group[id^="condensed-view-items-"]
    > .list-group-item.condensed-item-row:not(:first-child) {
    border-top-width: var(--bs-list-group-border-width);
}

.list-group[id^="condensed-view-items-"]
    > .list-group-item.condensed-item-row:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
     8. Page-Specific Styles
     ========================================================================== */

/* --- Dashboard Page --- */
.dashboard-activity-avatar {
    width: 40px;
    height: 40px;
    object-fit: cover;
}

/* --- Landing Page --- */
.landing-page-hero-image {
    max-height: 350px;
    object-fit: contain;
}

/* --- Sticky Layout (Ensures body is scrollable) --- */
html {
    height: 100%;
}
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-y: auto;
}
main {
    overflow: visible;
}

.hover-underline:hover {
    text-decoration: underline !important;
}

/* Fix for Select2 dropdowns in Bootstrap Modals */
.select2-container--open {
    z-index: 9999 !important;
}

/* Hide Select2 tags for co-owners since we use external chips */
.select2-co-owners + .select2-container .select2-selection--multiple .select2-selection__choice {
    display: none !important;
}
.select2-co-owners + .select2-container .select2-selection--multiple {
    padding-left: 0.5rem !important;
}
.select2-co-owners + .select2-container .select2-selection--multiple .select2-search--inline {
    margin-left: 0 !important;
}

/* Prettier co-owner chips */
.co-owner-chip {
    transition: all 0.2s ease-in-out;
    border: 1px solid rgba(0,0,0,0.05);
}
.co-owner-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.co-owner-remove-btn:hover {
    opacity: 1 !important;
}

/* ==========================================================================
   Utility Classes (extracted from inline styles)
   ========================================================================== */
.cursor-pointer {
    cursor: pointer;
}
.cursor-move {
    cursor: move;
}
.cursor-grab {
    cursor: grab;
}
.pre-line {
    white-space: pre-line;
}
.prose-content {
    line-height: 1.7;
}
.item-detail-image {
    max-height: 300px;
    object-fit: contain;
}
.admin-stat-icon {
    width: 48px;
    height: 48px;
}
.admin-feedback-thumb {
    max-height: 90px;
    max-width: 140px;
    object-fit: cover;
}
.admin-attachment-input {
    max-width: 240px;
}
.max-w-60 {
    max-width: 60%;
}
.ticket-attachment-img {
    max-height: 220px;
    max-width: 100%;
    object-fit: contain;
}
.ticket-attachment-img-sm {
    max-height: 180px;
    max-width: 100%;
    object-fit: contain;
}
.reply-image-preview-thumb {
    height: 60px;
    width: 60px;
    object-fit: cover;
}

/* ==========================================================================
   Mobile Touch Targets
   ========================================================================== */
.btn-touch {
    min-height: 44px;
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.btn-icon-touch {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 767.98px) {
    /* Touch targets and full-width bottom bar for action buttons on mobile list rows */
    .item-list-actions {
        width: 100%;
        display: flex;
        flex-wrap: nowrap;
        gap: 0.5rem;
    }

    .item-list-actions form {
        flex: 1 1 0;
        display: flex;
        min-width: 0;
    }

    .item-list-actions form .btn {
        width: 100%;
    }

    .item-list-actions .btn {
        min-height: 44px;
        font-weight: 500;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
    }

    .item-list-actions .btn:not(.btn-icon-touch) {
        flex: 1 1 0;
        min-width: 0;
        padding: 0.45rem 0.5rem;
    }

    .item-list-actions .dropdown {
        flex: 0 0 auto;
    }

    .item-list-actions .btn.btn-icon-touch {
        padding: 0;
        min-width: 44px;
        width: 44px;
    }

    /* Ensure segmented control buttons on mobile meet touch target standards */
    .segmented-control .btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (min-width: 768px) {
    .w-md-auto {
        width: auto !important;
    }

    .item-list-actions form {
        display: inline-flex;
    }

    /* Harmonized desktop action buttons on gift cards (36px height) */
    .item-list-actions .btn {
        height: 36px;
        min-height: 36px;
        font-weight: 500;
        font-size: 0.875rem;
        padding: 0 0.9rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
    }

    .item-list-actions .btn.btn-icon-touch {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        padding: 0;
    }
}

/* Drag and drop shake / wobble animation on long press */
@keyframes itemWobble {
    0% { transform: rotate(0deg) scale(1.02); }
    25% { transform: rotate(-1.2deg) scale(1.02); }
    75% { transform: rotate(1.2deg) scale(1.02); }
    100% { transform: rotate(0deg) scale(1.02); }
}

.sortable-item.sortable-chosen,
.sortable-series.sortable-chosen {
    animation: itemWobble 0.22s ease-in-out infinite;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2) !important;
    border-color: var(--bs-primary) !important;
    z-index: 1050 !important;
    cursor: grabbing !important;
}

.sortable-item.sortable-ghost,
.sortable-series.sortable-ghost {
    opacity: 0.35;
    border: 2px dashed var(--bs-primary) !important;
}

/* Ensure modal footer action buttons meet touch target standards */
.modal-footer .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Utility to allow flex items to shrink below their content size */
.min-width-0,
.min-w-0 {
    min-width: 0 !important;
}

/* Remove focus highlight on mobile navbar toggler after offcanvas close */
.navbar-toggler:focus {
    box-shadow: none;
    outline: none;
}

/* Mobile notification dropdown sizing */
#notification-list-mobile {
    width: 330px;
    max-width: calc(100vw - 2rem);
    right: 0;
    left: auto;
}

/* Prevent Floating Action Button (FAB) from covering last item card buttons on mobile */
@media (max-width: 767.98px) {
    #wishlist-items-container {
        padding-bottom: 5.5rem;
    }
}

/* Symetrické řádky odkazů na produkt v modálech (Varianta 1) */
.link-input-group {
    border-radius: 1rem;
}
.link-input-group .form-control {
    height: 48px;
    font-size: 0.95rem;
    padding: 0.75rem 1.25rem;
    background-color: var(--bs-body-bg);
    border-color: var(--bs-border-color);
    border-top-left-radius: 1rem !important;
    border-bottom-left-radius: 1rem !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-right: none !important;
}
.link-input-group .form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: none;
    z-index: 3;
}
.link-input-group .btn,
.link-input-group .btn:not(.btn-close):not(.navbar-toggler):not(.dropdown-toggle) {
    width: 50px;
    min-width: 50px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bs-body-bg) !important;
    border-color: var(--bs-border-color) !important;
    border-radius: 0 1rem 1rem 0 !important;
    border-left: 1px solid var(--bs-border-color) !important;
    padding: 0;
    z-index: 2;
}
.link-input-group .btn-fetch-metadata {
    color: var(--bs-secondary-color) !important;
}
.link-input-group .btn-fetch-metadata:hover,
.link-input-group .btn-fetch-metadata:active {
    background-color: var(--bs-tertiary-bg) !important;
    color: var(--bs-primary) !important;
}
.link-input-group .delete-link-row,
.link-input-group .btn-link-row-delete {
    color: var(--bs-danger) !important;
}
.link-input-group .delete-link-row:hover,
.link-input-group .delete-link-row:active,
.link-input-group .btn-link-row-delete:hover,
.link-input-group .btn-link-row-delete:active {
    background-color: rgba(var(--bs-danger-rgb), 0.08) !important;
    color: var(--bs-danger) !important;
}

/* Currency selection in price input group */
.input-group-currency-select {
    max-width: 130px;
    flex-shrink: 0;
}

/* ==========================================================================
   Reorder Mode & Sortable Styling (Desktop & Mobile)
   ========================================================================== */
.reorder-mode-banner {
    top: 70px;
    z-index: 1020;
    border-radius: var(--bs-border-radius-lg, 0.5rem);
}

.reorder-mode-active .reorder-controls-mobile,
.reorder-mode-active .reorder-controls-category {
    display: inline-flex !important;
}

.reorder-mode-active .open-item-detail-modal {
    pointer-events: none !important;
    cursor: default !important;
}

.reorder-mode-active .fab-add-item,
.reorder-mode-active .btn-add-to-series,
.reorder-mode-active .btn-add-to-category,
.reorder-mode-active .btn-edit-category-note,
.reorder-mode-active .btn-edit-series {
    display: none !important;
}

.reorder-mode-active .item-desktop-actions,
.reorder-mode-active .col-12.d-md-none.border-top {
    opacity: 0.35;
    pointer-events: none !important;
}

.reorder-mode-active .sortable-item,
.reorder-mode-active .sortable-series,
.reorder-mode-active .sortable-category-section {
    transition: transform 0.15s ease;
}

.btn-reorder-up,
.btn-reorder-down {
    width: 38px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    border-radius: var(--bs-border-radius, 0.375rem);
    background-color: var(--bs-body-bg);
}

.condensed-item-row .btn-reorder-up,
.condensed-item-row .btn-reorder-down,
.btn-reorder-cat-up,
.btn-reorder-cat-down {
    width: 32px;
    height: 30px;
    font-size: 0.875rem;
}

.btn-reorder-up:disabled,
.btn-reorder-down:disabled,
.btn-reorder-cat-up:disabled,
.btn-reorder-cat-down:disabled {
    opacity: 0.25 !important;
    pointer-events: none;
}

.reorder-touch-handle,
.reorder-cat-touch-handle {
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
    padding: 0.25rem 0.35rem;
}

.reorder-touch-handle:active,
.reorder-cat-touch-handle:active,
.handle:active,
.handle-series:active,
.handle-category:active {
    cursor: grabbing !important;
}

/* SortableJS drag states */
.sortable-ghost {
    opacity: 0.35 !important;
    border: 2px dashed var(--bs-primary, #0d6efd) !important;
    background-color: var(--bs-primary-bg-subtle, rgba(13, 110, 253, 0.1)) !important;
}

.sortable-chosen {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* ==========================================================================
   Dark Mode Overhaul & Third-Party Widgets (Select2, Pickr, etc.)
   ========================================================================== */

/* 1. Dashed Border Utility */
.border-dashed {
    border-style: dashed !important;
}

/* 2. Co-owner Chips in Dark Mode */
[data-bs-theme="dark"] .co-owner-chip {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background-color: var(--bs-secondary-bg);
}

/* 3. Select2 Bootstrap 5 Theme Dark Mode Overrides */
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: var(--bs-body-color);
}
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__placeholder {
    color: var(--bs-secondary-color);
}
[data-bs-theme="dark"] .select2-container--bootstrap-5.select2-container--focus .select2-selection,
[data-bs-theme="dark"] .select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown .select2-search .select2-search__field {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__option {
    color: var(--bs-body-color);
}
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__option--highlighted[aria-selected] {
    background-color: var(--bs-primary);
    color: #ffffff;
}
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__option[aria-selected="true"] {
    background-color: var(--bs-secondary-bg);
    color: var(--bs-body-color);
}
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    background-color: var(--bs-secondary-bg);
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--bs-secondary-color);
}
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: var(--bs-danger);
}

/* 4. Pickr (Color Picker) Overrides */
.pcr-button {
    border: 2px solid var(--bs-border-color) !important;
    border-radius: 50rem !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
    overflow: hidden !important;
}
.pcr-button::before,
.pcr-button::after {
    border-radius: inherit !important;
    transition: none !important;
}
.pcr-button.clear {
    background-color: rgba(0, 0, 0, 0.05) !important;
}
[data-bs-theme="dark"] .pcr-button.clear {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .pcr-app {
    background: var(--bs-body-bg) !important;
    border: 1px solid var(--bs-border-color) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    color: var(--bs-body-color) !important;
}
[data-bs-theme="dark"] .pcr-app .pcr-interaction input {
    color: var(--bs-body-color) !important;
    border: 1px solid var(--bs-border-color) !important;
    border-radius: 0.5rem !important;
}
[data-bs-theme="dark"] .pcr-app .pcr-interaction .pcr-save {
    background-color: var(--bs-primary) !important;
    color: #ffffff !important;
}
[data-bs-theme="dark"] .pcr-app .pcr-interaction .pcr-clear,
[data-bs-theme="dark"] .pcr-app .pcr-interaction .pcr-cancel {
    background-color: var(--bs-secondary-bg) !important;
    color: var(--bs-body-color) !important;
}

/* 5. Default placeholder image soft contrast in dark mode */
[data-bs-theme="dark"] img[src*="placeholder"],
[data-bs-theme="dark"] img[src*="default_gift"] {
    opacity: 0.9;
    filter: brightness(0.92);
}

/* 6. Admin Feedback Batch Selection & Highlights */
.feedback-item-card {
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.feedback-item-card.feedback-card-selected {
    box-shadow: 0 0 0 2px var(--bs-primary), 0 10px 30px rgba(0, 0, 0, 0.08) !important;
}

[data-bs-theme="dark"] .feedback-item-card.feedback-card-selected {
    box-shadow: 0 0 0 2px var(--bs-primary), 0 10px 30px rgba(0, 0, 0, 0.35) !important;
}

.feedback-select-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

/* ==========================================================================
   9. URL Metadata Fetcher & Candidate Image Picker (Podněty #42 & #41)
   ========================================================================== */
.btn-xs {
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    line-height: 1.2;
}

.metadata-selected-card {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.metadata-selected-card.drag-over {
    border: 2px dashed var(--bs-primary) !important;
    background-color: rgba(var(--bs-primary-rgb), 0.05) !important;
}

.metadata-dropzone-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(var(--bs-body-bg-rgb), 0.85);
    backdrop-filter: blur(2px);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--bs-border-radius, 0.375rem);
    pointer-events: none;
}

.metadata-thumbnail-strip {
    scrollbar-width: thin;
    scrollbar-color: var(--bs-border-color) transparent;
}

.metadata-thumbnail-strip::-webkit-scrollbar {
    height: 6px;
}

.metadata-thumbnail-strip::-webkit-scrollbar-thumb {
    background-color: var(--bs-border-color);
    border-radius: 3px;
}

.metadata-thumb-item {
    width: 68px;
    height: 68px;
    min-width: 68px;
    border: 2px solid var(--bs-border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    background-color: var(--bs-body-secondary);
    position: relative;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    padding: 0;
}

.metadata-thumb-item:hover {
    transform: translateY(-2px);
    border-color: var(--bs-primary);
}

.metadata-thumb-item.active {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), 0.35);
}

.metadata-thumb-item .thumb-check-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background-color: var(--bs-primary);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
}

.metadata-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 10. Support Center & Feedback Conversation */
.ticket-attachment-preview {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.ticket-attachment-preview:hover {
    opacity: 0.92;
    transform: scale(1.01);
}

.max-w-900 {
    max-width: 900px;
}

/* 11. Collapsible Member / Person Cards */
.member-collapse-icon {
    display: inline-block;
    transition: transform 0.2s ease-in-out;
}

[data-bs-toggle="collapse"][aria-expanded="true"] .member-collapse-icon,
[data-bs-toggle="collapse"]:not(.collapsed) .member-collapse-icon {
    transform: rotate(180deg);
}

[data-bs-toggle="collapse"][aria-expanded="false"] .member-collapse-icon,
[data-bs-toggle="collapse"].collapsed .member-collapse-icon {
    transform: rotate(0deg);
}
