/* Nextcloud Albums – Gallery CSS v1.2 */
.nca-album-wrap { --accent: #2563eb; position: relative; }
.nca-album-header { margin-bottom: 18px; }
.nca-album-title { font-size: clamp(1.3rem,2.5vw,1.9rem); font-weight: 700; margin: 0 0 6px; color: #1e293b; }
.nca-album-desc  { margin: 0; color: #64748b; font-size: 15px; }

.nca-breadcrumb {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    font-size: 13px; color: #94a3b8; margin-bottom: 14px;
}
.nca-bc-home, .nca-bc-item { color: var(--accent); cursor: pointer; }
.nca-bc-home:hover, .nca-bc-item:hover { text-decoration: underline; }
.nca-bc-sep { color: #cbd5e1; }

/* Grid */
.nca-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
    min-height: 80px;
}
@media(max-width:600px){ .nca-gallery { grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); } }

/* Spinner */
.nca-spinner { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 60px; grid-column: 1/-1; }
.nca-spinner span { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); animation: ncab .8s ease-in-out infinite; }
.nca-spinner span:nth-child(2){ animation-delay:.15s; }
.nca-spinner span:nth-child(3){ animation-delay:.3s; }
@keyframes ncab { 0%,80%,100%{transform:scale(.45);opacity:.35} 40%{transform:scale(1);opacity:1} }

/* Image tile */
.nca-img-tile {
    position: relative; aspect-ratio: 1; overflow: hidden;
    border-radius: 8px; cursor: pointer; background: #f1f5f9;
    transition: transform .2s, box-shadow .2s;
}
.nca-img-tile:hover { transform: scale(1.035); box-shadow: 0 8px 24px rgba(0,0,0,.16); }
.nca-img-tile img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .3s; }
.nca-img-tile img.loaded { opacity: 1; }
.nca-img-tile .overlay {
    position: absolute; inset: 0;
    background: linear-gradient(0deg, rgba(0,0,0,.5) 0%, transparent 55%);
    opacity: 0; transition: opacity .2s;
    display: flex; align-items: flex-end; padding: 8px;
}
.nca-img-tile:hover .overlay { opacity: 1; }
.nca-img-tile .overlay span { color: #fff; font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }

/* Folder tile */
.nca-folder-tile {
    aspect-ratio: 1; border-radius: 8px; cursor: pointer;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; color: #fff; transition: transform .2s, box-shadow .2s;
}
.nca-folder-tile:hover { transform: scale(1.04); box-shadow: 0 8px 24px rgba(79,70,229,.35); }
.nca-folder-tile .fi { font-size: 40px; line-height: 1; }
.nca-folder-tile .fn { font-size: 12px; font-weight: 600; text-align: center; padding: 0 8px; word-break: break-word; }

/* Messages */
.nca-error { background: #fef2f2; color: #991b1b; padding: 12px 16px; border-radius: 8px; border-left: 4px solid #ef4444; font-size: 14px; }
.nca-msg   { text-align: center; color: #94a3b8; padding: 40px 20px; font-size: 14px; grid-column: 1/-1; }

/* Lightbox */
.nca-lightbox {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    animation: ncaFI .2s ease;
}
@keyframes ncaFI { from{opacity:0} to{opacity:1} }
.nca-lb-bg { position: absolute; inset: 0; background: rgba(0,0,0,.9); backdrop-filter: blur(5px); }

.nca-lb-close, .nca-lb-prev, .nca-lb-next {
    position: absolute; z-index: 2;
    background: rgba(255,255,255,.1); border: none; color: #fff;
    cursor: pointer; transition: background .15s; line-height: 1;
}
.nca-lb-close:hover, .nca-lb-prev:hover, .nca-lb-next:hover { background: rgba(255,255,255,.25); }
.nca-lb-close { top: 14px; right: 16px; font-size: 20px; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.nca-lb-prev  { left: 10px; top: 50%; transform: translateY(-50%); font-size: 34px; width: 46px; height: 64px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.nca-lb-next  { right: 10px; top: 50%; transform: translateY(-50%); font-size: 34px; width: 46px; height: 64px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }

.nca-lb-stage { position: relative; z-index: 1; max-width: 92vw; max-height: 84vh; display: flex; align-items: center; justify-content: center; }
.nca-lb-img { max-width: 92vw; max-height: 82vh; object-fit: contain; border-radius: 5px; box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: ncaII .22s ease; }
@keyframes ncaII { from{opacity:0;transform:scale(.95)} to{opacity:1;transform:scale(1)} }
.nca-lb-loader { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; gap: 7px; }
.nca-lb-loader.on { display: flex; }
.nca-lb-loader span { width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: ncab .8s ease-in-out infinite; }
.nca-lb-loader span:nth-child(2){ animation-delay:.15s; }
.nca-lb-loader span:nth-child(3){ animation-delay:.3s; }

.nca-lb-bar {
    position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
    z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.nca-lb-caption { color: rgba(255,255,255,.8); font-size: 13px; max-width: 80vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nca-lb-count   { color: rgba(255,255,255,.4); font-size: 12px; }
