/* Custom styles goes here */

/* Magic Sparkle Animation */
.magic-sparkle {
    position: fixed;
    pointer-events: none;
    background: var(--bs-primary, #8c57ff);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    z-index: 9999;
    animation: sparkle-fade 1.2s ease-out forwards;
    filter: blur(1px);
}

@keyframes sparkle-fade {
    0% { transform: scale(0) translateY(0) rotate(0deg); opacity: 1; }
    30% { opacity: 1; }
    100% { transform: scale(1.5) translateY(-20px) rotate(180deg); opacity: 0; }
}

/* ── Table header gradient ───────────────────────────────────────────────── */
table thead.table-light th {
    background: linear-gradient(to bottom, #5a2fc2 0%, #7c4ddb 55%, #8c57ff 100%);
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.15);
    font-weight: 600;
    letter-spacing: .025em;
}
/* ──────────────────────────────────────────────────────────────
   Mobile / tablet responsive overrides for ViewListing header.
   Desktop (>768px) is untouched — all rules are inside
   max-width: 767.98px / 379.98px media queries.
   ────────────────────────────────────────────────────────────── */

/* iOS notch / safe-area support so content isn't clipped. */
@supports (padding: max(0px)) {
    .view-listing-header {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

/* Icon spacing for buttons with text (desktop view) */
.icon-margin {
    margin-right: 3px !important;
}

/* Responsive hamburger menu padding on mobile */
@media (max-width: 767.98px) {
    .layout-menu-toggle {
        margin-left: 0.5rem !important;
        padding-left: 0.5rem !important;
    }

    /* Remove icon margin on mobile since text is hidden */
    .icon-margin {
        margin-right: 0 !important;
    }

    /* Compact the 4 tabs (Images, Overlay, Enhanced, Video) */
    #image-tabs {
        flex-wrap: wrap;
        gap: 0 0.25rem;
        padding-left: 0.5rem;
    }

        #image-tabs .nav-item {
            margin-bottom: 0.25rem;
        }

        #image-tabs .nav-link {
            font-size: 0.8rem;
            padding: 0.35rem 0.6rem;
            white-space: nowrap;
        }

    /* Responsive navbar logo on mobile */
    .navbar-nav-right img[src*="banar-2-tt.png"],
    #layout-navbar img[src*="banar-2-tt.png"] {
        max-width: 180px;
        height: auto;
        max-height: 45px;
    }

    /* Prevent navbar from being too tall on mobile */
    .navbar-expand-xl {
        padding-top: 5px !important;
        padding-bottom: 5px !important;
    }
}

@media (max-width: 767.98px) {

    /* Let the header wrap onto multiple rows. */
    .view-listing-header {
        flex-wrap: wrap;
        row-gap: 0.5rem;
    }

        /* Title group: take full width so the action buttons are
       forced onto a new line below. */
        .view-listing-header > .d-flex.align-items-center {
            flex: 1 1 100%;
            max-width: 100%;
            min-width: 0;
        }

        /* Make the h2 banner much smaller on phone, and allow
       long car titles to wrap inside the row. */
        .view-listing-header h2 {
            font-size: 1.1rem;
            line-height: 1.25;
            min-width: 0;
            overflow-wrap: break-word;
        }

        /* Narrower back button — icon only, compact padding. */
        .view-listing-header > .d-flex.align-items-center > a.btn {
            padding: 0.25rem 0.5rem;
            margin-right: 0.5rem !important;
            min-height: 36px;
            line-height: 1;
        }

        /* Action button group: own row, fill width, icon-only
       labels on phone (text hidden, icons kept). */
        .view-listing-header > .d-flex.gap-2 {
            flex: 1 1 100%;
            max-width: 100%;
            width: 100%;
            flex-wrap: wrap;
            gap: 0.5rem !important;
        }

            .view-listing-header > .d-flex.gap-2 .btn {
                flex: 1 1 0;
                min-width: 0;
                padding: 0.65rem 0.75rem;
                min-height: 42px;
                display: flex;
                align-items: center;
                justify-content: center;
            }
                /* Hide button text on mobile without breaking icon fonts */
                .view-listing-header > .d-flex.gap-2 .btn span:not([class*="ri"]):not([class*="icon"]),
                .view-listing-header > .d-flex.gap-2 .btn text {
                    position: absolute !important;
                    width: 1px !important;
                    height: 1px !important;
                    padding: 0 !important;
                    margin: -1px !important;
                    overflow: hidden !important;
                    clip: rect(0, 0, 0, 0) !important;
                    white-space: nowrap !important;
                    border: 0 !important;
                }

                .view-listing-header > .d-flex.gap-2 .btn i,
                .view-listing-header > .d-flex.gap-2 .btn svg,
                .view-listing-header > .d-flex.gap-2 .btn [class*="ri-"] {
                    font-size: 1.35rem;
                    line-height: 1;
                    margin: 0 !important;
                }

    /* Hide button text on mobile - Print, Enhance, Create Video */
    .print-text,
    .enhance-text,
    .video-text {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }

    /* Hide Edit button text on mobile */
    .edit-text {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }

    /* Hide Download All text on mobile */
    .download-text {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }

    /* Compact the 4 tabs text on mobile */
    #image-tabs .nav-link {
        font-size: 0.8rem;
    }
}

/* On very narrow phones (<380px) the three icon buttons can
   still feel cramped — stack them vertically. */
@media (max-width: 379.98px) {
    .view-listing-header > .d-flex.gap-2 {
        flex-direction: column;
    }

        .view-listing-header > .d-flex.gap-2 .btn {
            width: 100%;
        }
}
