body {
    margin: 0;
    padding: 0;
}

.bento-toolbar {
    width: 100%;
    margin-bottom: 1em;
    padding: 0;
    box-sizing: border-box;
}

#bento-search-input {
    width: 100%;
    padding: 0.875em 1em;
    font-size: 1em;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    margin-bottom: 1em;
    background: #ffffff;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

/* Simple hover effect for buttons that are NOT active */
.bento-media-category-buttons .bento-category-filter:not(.active):hover {
    background: rgba(0, 156, 222, 0.1);
    color: #000;
    border-color: #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 156, 222, 0.1);
}

#bento-search-input:focus {
    outline: none;
    border-color: #009cde;
    box-shadow: 0 0 0 3px rgba(0, 156, 222, 0.1), 0 4px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.bento-toolbar-buttons {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.bento-toolbar-buttons button {
    padding: 0.875em 1.5em;
    font-size: 0.95em;
    font-weight: 500;
    background: linear-gradient(135deg, #000000 0%, #000000 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 25px;
    height: 50px;
    display: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    letter-spacing: 0.025em;
    position: relative;
    overflow: hidden;
}

.bento-toolbar-buttons button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.bento-toolbar-buttons button:hover::before {
    left: 100%;
}

.bento-toolbar-buttons button:hover {
    background: linear-gradient(135deg, #009cde 0%, #0074a8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 156, 222, 0.3);
}

.bento-toolbar-buttons button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.bento-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.8em;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
    /* Prevent overflow while maintaining responsiveness */
    max-width: 100%;
    overflow-x: hidden;
}

.bento-item {
    width: 100%;
    aspect-ratio: 1;
    min-width: 140px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border-radius: 12px;
    border: 3px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

.bento-item:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.bento-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
    transition: all 0.3s ease;
    margin: 0;
    padding: 0;
}

.bento-item:hover img {
    transform: scale(1.05);
}

.bento-item.selected .bento-overlay {
    display: flex !important;
    background-color: rgba(0, 128, 0, 0.5) !important; /* enforce green on selection */
}

.bento-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 128, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3; /* above ::before and content so PDFs are covered */
    border-radius: inherit;
}
.bento-overlay::before {
    content: "";
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
}

/* Ensure a consistent green highlight on selected media */
.bento-item.selected {
    border-color: #008000; /* green */
    box-shadow: 0 0 0 3px rgba(0, 128, 0, 0.25);
}

.bento-item::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.6) 100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    border-radius: 9px;
}
.bento-item:hover::before {
    opacity: 1;
}
.bento-item.selected:hover::before {
    opacity: 0;
}

.bento-arrow-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

.bento-arrow-icon::before {
    content: "";
    width: 12px;
    height: 12px;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23333" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 3h7v7h-2V6.41l-9.29 9.3-1.42-1.42 9.3-9.29H14V3z"/></svg>');
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
}

.bento-item:hover .bento-arrow-icon {
    opacity: 1;
    transform: scale(1.1);
}

.bento-arrow-icon:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.2);
}


/* Popup layout */
.bento-lightbox {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.bento-lightbox-content {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
    gap: 20px;
    padding: 40px 20px;
    box-sizing: border-box;
}
.bento-lightbox img {
    max-width: 80vw;
    max-height: 60vh;
    border-radius: 35px;
    display: block;
    object-fit: contain;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* Video and iframe elements in lightbox */
.bento-lightbox video,
.bento-lightbox iframe {
    max-width: 80vw;
    max-height: 60vh;
    border-radius: 35px;
    display: block;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* Ensure video containers don't interfere */
.bento-lightbox-video,
.bento-lightbox-document,
.bento-lightbox-vector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    max-width: 80vw;
    flex-shrink: 0;
}

/* Close button X next to image - Updated style */
.bento-lightbox-close {
    position: absolute;
    top: calc(10vh + 15px);
    right: calc(10vw + 15px);
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%; /* Circular like arrow buttons */
    font-size: 20px;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.bento-lightbox-close:hover {
    background: rgba(220, 38, 38, 0.9);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

/* Action buttons container */
.bento-lightbox-actions {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1002;
    margin-top: auto;
}

/* Download and Email buttons - Updated with consistent styling */
.bento-lightbox-btn {
    padding: 0.875em 1.75em;
    background: linear-gradient(135deg, #000000 0%, #000000 100%);
    color: #fff;
    border: none;
    border-radius: 20px; /* Rounded corners to match design */
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 160px;
    justify-content: center;
    height: 52px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    letter-spacing: 0.025em;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.bento-lightbox-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.bento-lightbox-btn:hover::after {
    left: 100%;
}

.bento-lightbox-btn:hover {
    background: linear-gradient(135deg, #009cde 0%, #0074a8 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 156, 222, 0.3);
}

.bento-lightbox-btn:active {
    transform: translateY(0);
}

/* Icons for buttons */
.bento-lightbox-btn::before {
    content: "";
    width: 18px;
    height: 18px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.bento-lightbox-download::before {
    background-image: url('data:image/svg+xml;utf8,<svg fill="white" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 15.577l-3.539-3.538 1.061-1.061L11.5 13V3h1v10l1.977-1.977 1.061 1.061L12 15.577zm7-3.038V19.5a.5.5 0 01-.5.5h-13a.5.5 0 01-.5-.5v-6.961h1V19h12v-6.461h1z"/></svg>');
}
.bento-lightbox-email::before {
    background-image: url('data:image/svg+xml;utf8,<svg fill="white" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/></svg>');
}

/* Lightbox navigation arrows - Updated with circular style */
.bento-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 28px;
    color: white;
    cursor: pointer;
    padding: 1.2em;
    user-select: none;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%; /* Circular like arrow buttons */
    z-index: 1001;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.bento-lightbox-nav:hover {
    background: rgba(0, 156, 222, 0.8);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 156, 222, 0.4);
}
.bento-lightbox-prev {
    left: 20px;
}
.bento-lightbox-next {
    right: 20px;
}

.bento-category-filter.active {
    background-color: #000;
    color: #fff;
}

/* Category buttons under search bar */
.bento-media-category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    margin: 0.5em 0 1.2em 0;
    width: 100%;
    justify-content: flex-start;
    box-sizing: border-box;
}

.bento-media-category-buttons .bento-category-filter {
    padding: 0.6em 1.5em;
    font-size: 0.95em;
    font-weight: 500;
    background: transparent;
    color: #000;
    border: 1px solid #000;
    border-radius: 25px;
    cursor: pointer;
    margin-bottom: 0.3em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    min-width: fit-content;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    letter-spacing: 0.025em;
    position: relative;
    overflow: hidden;
}

.bento-media-category-buttons .bento-category-filter::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.bento-media-category-buttons .bento-category-filter:hover::before {
    left: 100%;
}


/* Selected (active) or keyboard‑focused category button */
.bento-media-category-buttons .bento-category-filter.active,
.bento-media-category-buttons .bento-category-filter.active:focus {
    background: linear-gradient(135deg, #009cde 0%, #0074a8 100%);
    color: #fff;
    border-color: #0074a8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 156, 222, 0.3);
}

/* A focused button that is not selected should look like the default “un‑selected” state */
.bento-media-category-buttons .bento-category-filter:focus:not(.active) {
    background: transparent;
    color: #000;
    border: 1px solid #009cde;
    box-shadow: 0 0 0 3px rgba(0, 156, 222, 0.1);
}

/* Simple hover effect for buttons that are NOT active */
.bento-media-category-buttons .bento-category-filter:not(.active):hover {
    background: rgba(0, 156, 222, 0.1);
    color: #000;
    border-color: #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 156, 222, 0.1);
}

/* ---------- Category‑edit modal ---------- */
.bento-category-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1100;
    backdrop-filter: blur(5px);
}
.bento-category-modal-inner {
    background: #fff;
    padding: 2em;
    border-radius: 16px;
    max-height: 80vh;
    overflow-y: auto;
    width: 360px;
    box-sizing: border-box;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
#bento-category-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
#bento-category-modal-close:hover {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}
.bento-category-modal-inner .cat-list label {
    display: block;
    margin: 8px 0;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    cursor: pointer;
}
.bento-category-modal-inner .cat-list label:hover {
    background-color: #f1f5f9;
}

/* ==================== RESPONSIVE DESIGN ==================== */

/* Mobile devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    .bento-toolbar {
        padding: 0;
    }
    
    #bento-search-input {
        padding: 0.6em;
        font-size: 0.95em;
    }
    
    .bento-media-category-buttons {
        margin: 0.5em 0 1em 0;
        width: 100%;
        gap: 0.4em;
    }
    
    .bento-media-category-buttons .bento-category-filter {
        padding: 0.4em 0.8em;
        font-size: 0.9em;
        flex: 1;
        min-width: fit-content;
    }
    
    .bento-gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.6em;
        padding: 0;
    }
    
    .bento-item {
        min-width: 120px;
        border-radius: 4px;
    }
    
    .bento-item img {
        border-radius: 4px;
    }
    
    /* Adjust thumbnail buttons for mobile */
    .bento-grid-btn {
        font-size: 8px;
        padding: 4px 6px;
        min-height: 20px;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .bento-gallery {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 0.7em;
    }
    
    .bento-item {
        min-width: 130px;
    }
    
    .bento-media-category-buttons .bento-category-filter {
        padding: 0.42em 1em;
        font-size: 0.95em;
        flex: 1;
        min-width: fit-content;
    }
    
    /* Adjust thumbnail buttons for small devices */
    .bento-grid-btn {
        font-size: 9px;
        padding: 5px 7px;
        min-height: 22px;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .bento-gallery {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.8em;
    }
    
    .bento-item {
        min-width: 140px;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .bento-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.9em;
    }
    
    .bento-item {
        min-width: 150px;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .bento-gallery {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1em;
    }
    
    .bento-item {
        min-width: 160px;
    }
}

/* High resolution displays */
@media (min-width: 1400px) {
    .bento-gallery {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 1.1em;
    }
    
    .bento-item {
        min-width: 170px;
    }
}

/* Ultra-wide screens */
@media (min-width: 1600px) {
    .bento-gallery {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1.2em;
    }
    
    .bento-item {
        min-width: 180px;
    }
}

/* ==================== TABLET-SPECIFIC RESPONSIVE FIXES ==================== */

/* Use auto-fill with appropriate min sizes for gradual responsive behavior */

/* Large tablets and small desktops (1024-1199px) - allow 4-5 columns */
@media (min-width: 1024px) and (max-width: 1199.98px) {
    .bento-gallery {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
        gap: 0.8em;
    }
    
    .bento-item {
        min-width: 200px;
    }
}

/* Medium tablets (900-1023px) - allow 3-4 columns */
@media (min-width: 900px) and (max-width: 1023.98px) {
    .bento-gallery {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
        gap: 0.8em;
    }
    
    .bento-item {
        min-width: 220px;
    }
}

/* Small tablets and iPad landscape (768-899px) - allow 2-3 columns */
@media (min-width: 768px) and (max-width: 899.98px) {
    .bento-gallery {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
        gap: 0.8em;
    }
    
    .bento-item {
        min-width: 240px;
    }
}

/* iPad Portrait and small tablets (576-767px) - allow 2 columns */
@media (min-width: 576px) and (max-width: 767.98px) {
    .bento-gallery {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
        gap: 0.8em;
    }
    
    .bento-item {
        min-width: 250px;
    }
}

/* Mobile devices - force 2 columns max */
@media (max-width: 575.98px) {
    .bento-gallery {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.6em;
    }
    
    .bento-item {
        min-width: 120px;
    }
}

/* ==================== RESPONSIVE BUTTON TEXT ==================== */

/* Toolbar buttons responsive text */
@media (max-width: 767.98px) {
    .bento-toolbar-buttons button {
        font-size: 0.85em;
        padding: 0.75em 1.2em;
        min-width: 80px;
    }
    
    .bento-toolbar-buttons {
        gap: 6px;
    }
}

/* Grid buttons responsive sizing */
@media (max-width: 1023.98px) {
    .bento-grid-btn {
        font-size: 9px;
        padding: 4px 6px;
        min-height: 20px;
        border-radius: 12px;
    }
}

@media (max-width: 767.98px) {
    .bento-grid-btn {
        font-size: 8px;
        padding: 3px 5px;
        min-height: 18px;
        border-radius: 10px;
    }
}

@media (max-width: 575.98px) {
    .bento-grid-btn {
        font-size: 7px;
        padding: 2px 4px;
        min-height: 16px;
        border-radius: 8px;
    }
}

/* Responsive lightbox buttons - Updated to prevent overlap */
@media (max-width: 768px) {
    .bento-lightbox-close {
        top: calc(15vh + 5px);
        right: calc(5vw + 5px);
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .bento-lightbox img {
        max-width: 90vw;
        max-height: 70vh;
    }
    
    .bento-lightbox-actions {
        bottom: 20px;
        flex-direction: column;
        gap: 10px;
    }
    
    .bento-lightbox-btn {
        padding: 10px 16px;
        font-size: 13px;
        min-width: 120px;
        height: 44px;
    }
    
    .bento-lightbox-btn::before {
        width: 16px;
        height: 16px;
    }
    
    .bento-lightbox-copyright {
        font-size: 0.8em;
        padding: 4px 10px;
        align-self: center;
    }
    
    /* Show popup navigation arrows on mobile with adjusted size */
    .bento-lightbox-nav {
        display: flex;
        width: 44px;
        height: 44px;
        font-size: 20px;
        padding: 0.8em;
    }
}

@media (max-width: 480px) {
    .bento-lightbox img {
        max-width: 95vw;
        max-height: 60vh;
        border-radius: 20px;
    }
    
    .bento-lightbox-close {
        top: calc(20vh + 5px);
        right: calc(2.5vw + 5px);
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .bento-lightbox-actions {
        bottom: 15px;
        left: 20px;
        right: 20px;
        transform: none;
    }
    
    .bento-lightbox-btn {
        flex: 1;
        padding: 12px 8px;
        font-size: 12px;
        min-width: auto;
        height: 40px;
    }
    
    .bento-lightbox-copyright {
        font-size: 0.75em;
        padding: 3px 8px;
        align-self: center;
    }
    
    /* Show popup navigation arrows on small mobile with adjusted size */
    .bento-lightbox-nav {
        display: flex;
        width: 40px;
        height: 40px;
        font-size: 18px;
        padding: 0.6em;
    }
}

/* Desktop-only popup navigation */
@media (min-width: 769px) {
    .bento-lightbox-nav {
        display: flex;
    }
}

/* Grid view action buttons - Updated with rounded style */
.bento-item-actions {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    display: none;
    flex-direction: row;
    gap: 6px;
    z-index: 3;
}

.bento-item:hover .bento-item-actions {
    display: flex;
}

.bento-grid-btn {
    flex: 1;
    padding: 6px 8px;
    background: linear-gradient(135deg, #000000 0%, #000000 100%);
    color: #fff;
    border: none;
    border-radius: 25px; /* More rounded like other buttons */
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    letter-spacing: 0.025em;
    position: relative;
    backdrop-filter: blur(10px);
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bento-grid-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.bento-grid-btn:hover::before {
    left: 100%;
}

.bento-grid-btn:hover {
    background: linear-gradient(135deg, #009cde 0%, #0074a8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 156, 222, 0.3);
}

.bento-grid-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}



/* Copyright line in lightbox */
.bento-lightbox-copyright {
    color: white;
    font-size: 0.9em;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.8);
    padding: 8px 16px;
    border-radius: 20px;
    white-space: nowrap;
    display: none;
    align-self: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 0.025em;
}

/* Simplified Tags Display in Lightbox */
.bento-tags-container {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 80vw;
}

.bento-tags-display {
    color: white;
    text-align: center;
    max-width: 600px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Media name styling */
.media-name {
    font-size: 1.1em;
    font-weight: 600;
    color: white;
    margin-bottom: 6px;
    letter-spacing: 0.025em;
    line-height: 1.3;
    word-break: break-word;
}

/* File info styling */
.media-info {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: 0.025em;
}

/* Tags section */
.tags-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.tags-loading {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
    font-style: italic;
}

.tags-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
    font-weight: 500;
    letter-spacing: 0.025em;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.bento-tag {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 500;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    letter-spacing: 0.025em;
}

.bento-tag:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.no-tags {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9em;
    font-style: italic;
    padding: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .bento-tags-display {
        max-width: 90%;
        gap: 10px;
    }
    
    .media-name {
        font-size: 1em;
    }
    
    .media-info {
        font-size: 0.85em;
    }
    
    .tags-list {
        gap: 6px;
    }
    
    .bento-tag {
        font-size: 0.8em;
        padding: 5px 10px;
    }
}

/* Mobile highlight animation for navigation feedback */
.bento-mobile-highlight {
    animation: mobileHighlight 0.6s ease-out;
    transform: scale(1.02);
}

@keyframes mobileHighlight {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 156, 222, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(0, 156, 222, 0.3);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 0 0 20px rgba(0, 156, 222, 0);
        transform: scale(1);
    }
}

/* Accessibility and focus styles */
.bento-item:focus {
    outline: 3px solid rgba(0, 156, 222, 0.6);
    outline-offset: 2px;
    border-radius: 12px;
}

.bento-mobile-nav-btn:focus {
    outline: 2px solid rgba(0, 156, 222, 0.8);
    outline-offset: 2px;
}

.bento-grid-btn:focus {
    outline: 2px solid rgba(0, 156, 222, 0.8);
    outline-offset: 2px;
}

.bento-lightbox-btn:focus {
    outline: 2px solid rgba(0, 156, 222, 0.8);
    outline-offset: 2px;
}

.bento-lightbox-close:focus {
    outline: 2px solid rgba(0, 156, 222, 0.8);
    outline-offset: 2px;
}

.bento-lightbox-nav:focus {
    outline: 2px solid rgba(0, 156, 222, 0.8);
    outline-offset: 2px;
}

/* Enhanced keyboard navigation indicators */
.bento-item:focus .bento-mobile-nav {
    display: flex;
    opacity: 1;
}

.bento-item:focus-within {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bento-mobile-nav-btn,
    .bento-grid-btn,
    .bento-lightbox-btn,
    .bento-lightbox-close,
    .bento-lightbox-nav {
        border: 3px solid #000;
        background: #fff;
        color: #000;
    }
    
    .bento-item:focus {
        outline: 4px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .bento-mobile-nav-btn,
    .bento-grid-btn,
    .bento-lightbox-btn,
    .bento-lightbox-close,
    .bento-lightbox-nav,
    .bento-item {
        transition: none;
        animation: none;
    }
    
    .bento-mobile-highlight {
        animation: none;
        transform: none;
        box-shadow: 0 0 0 3px rgba(0, 156, 222, 0.5);
    }
}

/* File type styling */
.bento-item.is-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 9px;
}

.bento-pdf-preview,
.bento-file-preview {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: inherit;
    text-align: center;
    padding: 1em;
    box-sizing: border-box;
}

/* PDF preview orientation handling */
.bento-pdf-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* default */
    border-radius: 9px;
}
.bento-pdf-preview.pdf-portrait img {
    object-fit: contain; /* show full page without crop when vertical */
}
.bento-pdf-preview.pdf-landscape img {
    object-fit: cover; /* fill tile; slight crop acceptable for horizontal */
}

.bento-file-icon {
    font-size: 2.5em;
    margin-bottom: 0.5em;
}

.bento-file-name {
    font-size: 0.8em;
    font-weight: 500;
    color: #495057;
    word-break: break-word;
    line-height: 1.2;
}

.bento-item.is-document .bento-file-icon {
    color: #dc3545;
}

/* When selected, make document icons green as well for consistent selection color */
.bento-item.selected .bento-file-icon {
    color: #008000 !important;
}

/* Always green when selected, regardless of media type */
.bento-item.is-video .bento-overlay,
.bento-item.is-document .bento-overlay {
    background-color: rgba(0, 128, 0, 0.5) !important;
}

/* Media type indicators - Hidden */
.bento-item::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    /* Hide the dots completely */
    display: none !important;
}

.bento-item.is-video::after {
    content: '▶';
    color: #0066cc;
    /* Hidden by display: none !important above */
}

.bento-item.is-document::after {
    content: '📄';
    /* Hidden by display: none !important above */
}

.bento-item:hover::after {
    opacity: 1;
    /* Still hidden by display: none !important above */
}

/* Video controls styling */
.bento-item.is-video video::-webkit-media-controls {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bento-item.is-video:hover video::-webkit-media-controls {
    opacity: 1;
}

/* Document preview hover effects */
.bento-pdf-preview:hover,
.bento-file-preview:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    transform: scale(1.02);
}

/* Reduce padding to keep preview close to border */
.bento-pdf-preview { padding: 0; }

/* Prefer no-crop preview for PDFs */
.bento-pdf-preview img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    border-radius: inherit;
}

/* Responsive adjustments for different media types */
@media (max-width: 768px) {
    .bento-file-icon {
        font-size: 2em;
    }
    
    .bento-file-name {
        font-size: 0.7em;
    }
    
    .bento-item::after {
        width: 16px;
        height: 16px;
        font-size: 8px;
    }
}

/* Enhanced Admin Actions in Lightbox */
.bento-admin-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.bento-admin-actions .bento-lightbox-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    margin: 0 5px;
    transition: all 0.3s ease;
}

.bento-admin-actions .bento-lightbox-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.bento-admin-actions .bento-reset-media {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.bento-admin-actions .bento-rescan-media {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
}

.bento-admin-actions .action-icon {
    margin-right: 5px;
}

/* Enhanced Metadata Panel */
.bento-metadata-panel {
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 20px;
    margin-top: 20px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.bento-metadata-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bento-metadata-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.bento-metadata-section h4 {
    margin: 0 0 15px 0;
    color: #4ecdc4;
    font-size: 16px;
    display: flex;
    align-items: center;
}

.bento-metadata-section .section-icon {
    margin-right: 8px;
    font-size: 18px;
}

.bento-metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.metadata-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.metadata-item strong {
    color: #b0bec5;
    font-size: 14px;
}

.metadata-item span {
    color: white;
    font-size: 14px;
}

.extension-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

/* Admin Section in Metadata */
.bento-admin-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.bento-admin-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.bento-admin-buttons .bento-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.bento-admin-buttons .bento-reset-media {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.bento-admin-buttons .bento-rescan-media {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
}

.bento-admin-buttons .bento-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.bento-admin-buttons .bento-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.admin-help {
    font-size: 12px;
    color: #90a4ae;
    margin: 0;
    font-style: italic;
}

/* Enhanced Loading and Error Messages */
.bento-loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    margin: 20px auto;
    max-width: 350px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    text-align: center;
}

.bento-loading-indicator p {
    margin: 0 0 5px 0;
    font-weight: 500;
    font-size: 16px;
}

.bento-loading-indicator small {
    opacity: 0.8;
    font-size: 14px;
}

.bento-end-message {
    margin: 2rem auto;
    padding: 1.5rem;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.bento-end-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bento-end-content strong {
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
}

.bento-end-content span {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Loading indicator improvements */
.bento-loading-indicator {
    margin: 2rem auto;
    padding: 1.5rem;
    text-align: center;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.bento-loading-indicator p {
    margin: 0.5rem 0;
    color: #495057;
    font-weight: 500;
}

.bento-loading-indicator small {
    color: #6c757d;
    font-size: 0.85rem;
}

.bento-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #009cde;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Infinite Scroll Styles */
.bento-loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    margin: 20px auto;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.bento-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: bentoSpin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes bentoSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.bento-loading-indicator p {
    margin: 0;
    color: #646970;
    font-weight: 500;
}

.bento-scroll-sentinel {
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Enhanced Media Info Modal */
.bento-media-info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
}

.bento-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.bento-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-width: 800px;
}

.bento-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.bento-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.bento-media-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f6f7f7;
    min-height: 400px;
    border-radius: 12px 0 0 12px;
    position: relative;
}

.bento-media-preview img,
.bento-media-preview video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.bento-media-preview .file-icon {
    font-size: 5em;
    color: #646970;
}

.bento-media-details {
    padding: 30px;
    border-radius: 0 12px 12px 0;
}

.bento-media-details h3 {
    margin: 0 0 25px 0;
    font-size: 1.5em;
    color: #1d2327;
    line-height: 1.2;
}

.bento-meta-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.bento-meta-item {
    border-bottom: 1px solid #f0f0f1;
    padding-bottom: 15px;
}

.bento-meta-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.bento-meta-item strong {
    display: block;
    color: #1d2327;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bento-tags-list,
.bento-categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.bento-tag {
    background: #0073aa;
    color: #fff;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.8em;
    font-weight: 500;
}

.bento-category {
    background: #00a32a;
    color: #fff;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.8em;
    font-weight: 500;
}

.bento-ai-info {
    background: linear-gradient(135deg, #f6f7f7 0%, #e9ecef 100%);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #0073aa;
}

.bento-ai-info p {
    margin: 0 0 8px 0;
    color: #646970;
}

.bento-ai-info p:last-child {
    margin-bottom: 0;
}

.bento-modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.bento-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
}

.bento-btn-download {
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    color: #fff;
}

.bento-btn-download:hover {
    background: linear-gradient(135deg, #005177 0%, #003c56 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.bento-btn-email {
    background: linear-gradient(135deg, #00a32a 0%, #007d20 100%);
    color: #fff;
}

.bento-btn-email:hover {
    background: linear-gradient(135deg, #007d20 0%, #005a17 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,163,42, 0.3);
}

/* Dynamic Grid Columns */
.bento-gallery {
    transition: grid-template-columns 0.3s ease;
}

/* Responsive Modal */
@media (max-width: 1024px) {
    .bento-modal-content {
        grid-template-columns: 1fr;
        min-width: auto;
        width: 95vw;
        max-height: 95vh;
    }
    
    .bento-media-preview {
        border-radius: 12px 12px 0 0;
        min-height: 250px;
    }
    
    .bento-media-details {
        border-radius: 0 0 12px 12px;
        padding: 20px;
    }
    
    .bento-modal-actions {
        flex-direction: column;
    }
    
    .bento-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .bento-modal-content {
        width: 98vw;
        max-height: 98vh;
    }
    
    .bento-media-details {
        padding: 15px;
    }
    
    .bento-media-details h3 {
        font-size: 1.2em;
    }
    
    .bento-meta-grid {
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .bento-meta-item {
        padding-bottom: 10px;
    }
}

/* Keyboard shortcuts help */
.bento-keyboard-help {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.8em;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

.bento-keyboard-help.show {
    opacity: 1;
    transform: translateY(0);
}

.bento-keyboard-help p {
    margin: 0 0 5px 0;
}

.bento-keyboard-help p:last-child {
    margin-bottom: 0;
}

.bento-keyboard-help kbd {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
}

/* Progressive Image Loading States - Updated for instant quality */
.bento-lightbox-image.loading {
    /* Remove blur filter for instant crisp quality */
    transition: opacity 0.2s ease;
}

.bento-lightbox-image.medium-loaded {
    /* Remove blur filter for instant crisp quality */
    transition: opacity 0.2s ease;
}

.bento-lightbox-image.full-loaded {
    /* Ensure no filters applied for maximum image quality */
    filter: none;
}

/* Image compression optimization indicators */
.bento-item img[loading="lazy"] {
    transition: opacity 0.3s ease;
}

.bento-item img[loading="lazy"]:not([src]) {
    opacity: 0;
}

/* Responsive image container for better aspect ratio */
.bento-item {
    position: relative;
    overflow: hidden;
}

.bento-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.bento-item:hover img {
    transform: scale(1.05);
}

/* Loading states for gallery items */
.bento-item.loading {
    opacity: 0.6;
    pointer-events: none;
}

.bento-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: bentoSpin 1s linear infinite;
    z-index: 3;
}

/* Smooth transitions for grid changes */
.bento-gallery.transitioning {
    pointer-events: none;
}

.bento-gallery.transitioning .bento-item {
    transition: all 0.3s ease;
}

/* Enhanced accessibility */
.bento-item:focus-visible {
    outline: 3px solid #0073aa;
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(0, 115, 170, 0.2);
}

@media (prefers-reduced-motion: reduce) {
    .bento-spinner,
    .bento-item.loading::after {
        animation: none;
    }
    
    .bento-modal-content,
    .bento-btn,
    .bento-gallery,
    .bento-gallery .bento-item {
        transition: none;
    }
}

/* Print styles */
@media print {
    .bento-toolbar,
    .bento-modal-overlay,
    .bento-modal-content,
    .bento-loading-indicator,
    .bento-keyboard-help {
        display: none !important;
    }
    
    .bento-gallery {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
    }
    
    .bento-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* File Type Badges and Previews */
.bento-file-type-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
    z-index: 2;
    opacity: 0;
    transition: all 0.3s ease;
}

.bento-item:hover .bento-file-type-badge {
    opacity: 1;
}

/* File Preview Containers */
.bento-pdf-preview,
.bento-office-preview,
.bento-vector-preview,
.bento-audio-preview,
.bento-file-preview,
.bento-svg-preview,
.bento-video-preview {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 9px;
    padding: 15px;
    text-align: center;
    position: relative;
}

.bento-file-icon {
    font-size: 2.5em;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.bento-file-name {
    font-size: 0.85em;
    font-weight: 500;
    color: #495057;
    line-height: 1.3;
    margin-bottom: 5px;
    max-width: 100%;
    word-wrap: break-word;
}

/* Video Preview Enhancements */
.bento-video-preview {
    background: #000;
    color: white;
}

.bento-video-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 9px;
}

.bento-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    color: #000;
    z-index: 2;
    opacity: 0.8;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.bento-item:hover .bento-play-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Audio Preview */
.bento-audio-preview {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.bento-audio-icon {
    font-size: 3em;
    margin-bottom: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* SVG Preview */
.bento-svg-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
    border-radius: 9px;
}

/* Enhanced Lightbox File Info */
.bento-lightbox-file-info {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1003;
}

.bento-file-extension-badge {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bento-lightbox-file-info .bento-file-name {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: 500;
    backdrop-filter: blur(10px);
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Lightbox Document Styling */
.bento-lightbox-document,
.bento-lightbox-vector,
.bento-lightbox-audio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    max-width: 400px;
}

.bento-lightbox-document .bento-file-icon,
.bento-lightbox-vector .bento-file-icon {
    font-size: 5em;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.bento-lightbox-audio {
    background: rgba(0, 0, 0, 0.5);
    padding: 30px;
    border-radius: 20px;
    backdrop-filter: blur(20px);
}

.bento-lightbox-audio .bento-audio-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

/* Enhanced Lightbox Metadata Styles */
.bento-lightbox-file-info {
    position: absolute;
    bottom: 80px;
    left: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
    color: white;
    z-index: 1000;
}

.bento-file-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.bento-file-extension-badge {
    background: #007cba;
    color: white;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bento-file-name {
    font-size: 1.1em;
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bento-file-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    opacity: 0.8;
}

.bento-file-type {
    font-family: 'Courier, monospace';
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Enhanced quick metadata display */
.bento-quick-metadata {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.85em;
}

.quick-meta-item {
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 8px;
    border-radius: 6px;
    color: white;
    display: flex;
    align-items: center;
    gap: 4px;
}

.quick-meta-item strong {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9em;
}

.bento-metadata-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bento-metadata-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.bento-metadata-toggle .toggle-icon {
    font-size: 1.1em;
}

.bento-metadata-container {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1003;
    min-width: 300px;
    max-width: 90vw;
}

.bento-metadata-quick {
    background: rgba(0, 0, 0, 0.9);
    border-radius: 12px;
    padding: 16px;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    margin-bottom: 12px;
}

.bento-metadata-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #ffffff;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.bento-metadata-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.bento-metadata-toggle .toggle-icon {
    font-size: 16px;
}

.bento-quick-metadata {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.quick-meta-item {
    color: #ffffff;
    font-size: 13px;
    line-height: 1.4;
}

.quick-meta-item strong {
    color: #e0e0e0;
    font-weight: 600;
}

.quick-meta-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-size: 13px;
}

.quick-meta-loading .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Metadata Panel */
.bento-metadata-panel {
    background: rgba(0, 0, 0, 0.95);
    border-radius: 16px;
    padding: 0;
    backdrop-filter: blur(20px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
    max-height: 60vh;
    overflow-y: auto;
    min-width: 400px;
    animation: slideUp 0.3s ease-out;
}

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

.bento-metadata-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px 16px 0 0;
}

.bento-metadata-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
}

.bento-metadata-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 300;
    transition: all 0.2s ease;
}

.bento-metadata-close:hover {
    background: rgba(220, 38, 38, 0.8);
    border-color: rgba(220, 38, 38, 1);
    transform: scale(1.1);
}

.bento-metadata-content {
    padding: 0 24px 24px;
}

.bento-metadata-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: #ffffff;
    font-size: 14px;
}

.bento-metadata-loading .spinner {
    width: 24px;
    height:  24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.bento-metadata-error {
    text-align: center;
    padding: 40px;
    color: #ff6b6b;
    font-size: 14px;
}

/* Metadata Sections */
.bento-metadata-sections {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.bento-metadata-section {
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px;
}

.bento-metadata-section h4 {
    margin: 0 0 16px 0;
    color: #ffffff;
    font-size: 16px;
    font-weight:  600;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.metadata-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metadata-item.full-width {
    grid-column: 1 / -1;
}

.metadata-item label {
    color: #b0b0b0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metadata-item span {
    color: #ffffff;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}

.metadata-item .ai-processed {
    color: #4ade80;
    font-weight: 500;
}

.metadata-item .ai-description {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid #4ade80;
    font-style: italic;
    line-height: 1.5;
}

/*--------------------------------------------------------------
 # Elementor Widget Specific Styles
--------------------------------------------------------------*/

.elementor-bento-gallery {
    width: 100%;
}

.elementor-bento-gallery .bento-gallery {
    display: grid;
    gap: 15px;
}

.elementor-bento-gallery .bento-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.elementor-bento-gallery .bento-item img,
.elementor-bento-gallery .bento-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.elementor-bento-gallery .bento-item .bento-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.elementor-bento-gallery .bento-item:hover .bento-overlay {
    opacity: 1;
}

/* Ensure selected items are green in Elementor galleries (PDFs included) */
.elementor-bento-gallery .bento-item.selected .bento-overlay {
    background-color: rgba(0, 128, 0, 0.5) !important;
    opacity: 1 !important;
}

.elementor-bento-gallery .bento-arrow-icon {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 18px;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.elementor-bento-gallery .bento-arrow-icon::before {
    content: '⤢';
    font-weight: bold;
}

.elementor-bento-gallery .bento-item:hover .bento-arrow-icon {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.elementor-bento-gallery .bento-item-actions {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.elementor-bento-gallery .bento-item:hover .bento-item-actions {
    opacity: 1;
}

.elementor-bento-gallery .bento-grid-btn {
    flex: 1;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* File type previews for Elementor */
.elementor-bento-gallery .bento-file-preview,
.elementor-bento-gallery .bento-pdf-preview,
.elementor-bento-gallery .bento-office-preview,
.elementor-bento-gallery .bento-audio-preview,
.elementor-bento-gallery .bento-vector-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 20px;
}

.elementor-bento-gallery .bento-file-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.9;
}

.elementor-bento-gallery .bento-file-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.3;
    max-width: 100%;
    word-wrap: break-word;
}

.elementor-bento-gallery .bento-file-type-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Video preview for Elementor */
.elementor-bento-gallery .bento-video-preview {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.elementor-bento-gallery .bento-video-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.elementor-bento-gallery .bento-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.elementor-bento-gallery .bento-play-overlay:hover {
    background: rgba(0, 156, 222, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Audio preview for Elementor */
.elementor-bento-gallery .bento-audio-preview {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.elementor-bento-gallery .bento-audio-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* Toolbar styles for Elementor widget */
.elementor-bento-gallery .bento-toolbar {
    margin-bottom: 20px;
}

.elementor-bento-gallery .bento-search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.elementor-bento-gallery .bento-search-input:focus {
    outline: none;
    border-color: #009cde;
    box-shadow: 0 0 0 3px rgba(0, 156, 222, 0.1);
}

.elementor-bento-gallery .bento-media-category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.elementor-bento-gallery .bento-category-filter {
    padding: 8px 16px;
    background: transparent;
    border: 2px solid #e1e5e9;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.elementor-bento-gallery .bento-category-filter:hover {
    border-color: #009cde;
    background: rgba(0, 156, 222, 0.1);
}

.elementor-bento-gallery .bento-category-filter.active {
    background: #009cde;
    border-color: #009cde;
    color: white;
}

.elementor-bento-gallery .bento-toolbar-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.elementor-bento-gallery .bento-toggle-btn {
    padding: 10px 20px;
    background: #333;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

/* Download Modal Styles */
.bento-download-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
}

.bento-download-modal .bento-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.bento-download-modal .bento-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    padding: 30px;
    min-width: 400px;
    max-width: 90vw;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.bento-download-modal h3 {
    margin: 0 0 10px 0;
    font-size: 1.4em;
    color: #333;
    text-align: center;
}

.bento-download-modal p {
    margin: 0 0 20px 0;
    color: #666;
    text-align: center;
}

.bento-download-options {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.bento-download-options button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
}

.bento-btn-primary {
    background: #0073aa;
    color: white;
}

.bento-btn-primary:hover:not(:disabled) {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.bento-btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 2px solid #ddd;
}

.bento-btn-secondary:hover:not(:disabled) {
    background: #e0e0e0;
    border-color: #ccc;
    transform: translateY(-2px);
}

.bento-download-options button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.bento-download-modal .bento-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.bento-download-modal .bento-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* Enhanced Office File Display in Lightbox */
.bento-lightbox-document {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    max-width: 500px;
    min-height: 300px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.6) 100%);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.bento-office-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    width: 100%;
}

.bento-lightbox-document .bento-file-icon {
    font-size: 4em;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    flex-shrink: 0;
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.bento-office-info {
    flex: 1;
    text-align: left;
}

.bento-office-title {
    font-size: 1.4em;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 8px 0;
    line-height: 1.3;
    word-break: break-word;
}

.bento-office-type {
    font-size: 1em;
    font-weight: 500;
    color: #4ade80;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bento-office-type::before {
    content: '📂';
    font-size: 0.9em;
}

.bento-office-description {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    line-height: 1.4;
    font-style: italic;
}

.bento-office-actions {
    display: flex;
    gap: 15px;
    margin: 25px 0 20px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.bento-office-actions .bento-lightbox-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    min-width: 160px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.bento-office-open {
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.bento-office-open:hover {
    background: linear-gradient(135deg, #005177 0%, #003c56 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 115, 170, 0.4);
}

.bento-office-download {
    background: linear-gradient(135deg, #00a32a 0%, #007d20 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.bento-office-download:hover {
    background: linear-gradient(135deg, #007d20 0%, #005a17 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 163, 42, 0.4);
}

.bento-office-actions .btn-icon {
    font-size: 1.1em;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.bento-office-help {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 15px;
    margin-top: 10px;
    max-width: 100%;
}

.bento-office-help p {
    margin: 0;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

.bento-office-help strong {
    color: #4ade80;
}

/* Enhanced Office File Download Button States */
.bento-office-download.success-state {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%) !important;
    color: white !important;
    pointer-events: none;
}

.bento-office-download.error-state {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: white !important;
    pointer-events: none;
}

.bento-office-download .loading-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Office File Button Hover Effects */
.bento-office-open:hover .btn-icon,
.bento-office-download:hover .btn-icon {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* Office File Type Specific Colors */
.bento-item[data-mime-type*="word"] .bento-office-preview {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.bento-item[data-mime-type*="powerpoint"] .bento-office-preview,
.bento-item[data-mime-type*="presentation"] .bento-office-preview {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.bento-item[data-mime-type*="keynote"] .bento-office-preview {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

/* Excel and CSV file specific styling */
.bento-item[data-mime-type*="spreadsheet"] .bento-office-preview,
.bento-item[data-extension="xlsx"] .bento-office-preview,
.bento-item[data-extension="xls"] .bento-office-preview {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.bento-item[data-extension="csv"] .bento-office-preview {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
}
