/* LinkThing - UIkit overrides & custom components */

/* Navbar padding */
.uk-navbar-container {
    padding-left: 20px;
    padding-right: 20px;
}

/* HTMX loading indicators */
.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    opacity: 1;
}

/* Folder color dot */
.folder-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

/* Color picker input */
input[type="color"] {
    width: 50px;
    height: 38px;
    padding: 2px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    cursor: pointer;
}

/* Link favicon */
.link-favicon {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Description line clamping */
.link-description {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Bulk action bar */
.bulk-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 2px solid #e5e7eb;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    z-index: 1100;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}
.bulk-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    flex-shrink: 0;
}
.bulk-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.bulk-select {
    width: auto;
    min-width: 130px;
}

/* Link view image container */
.link-view-image {
    margin: -30px -30px 20px -30px;
    border-radius: 5px 5px 0 0;
    overflow: hidden;
    max-height: 300px;
}
.link-view-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    background: #f8f8f8;
}

/* Folder badge with dynamic colors */
.folder-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.875rem;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
}
.folder-badge:hover {
    opacity: 0.9;
    text-decoration: none;
    color: #fff;
}

/* Bulk checkbox in link cards */
.link-select {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
    margin-top: 2px;
}

/* Faster off-canvas transitions */
.uk-offcanvas-bar {
    transition-duration: 100ms !important;
}
.uk-offcanvas-overlay::before {
    transition-duration: 100ms !important;
}

/* Responsive page headers and folder items */
@media (max-width: 640px) {
    .page-header > h1 {
        width: 100%;
    }
    .folder-item-row > .uk-button-group {
        width: 100%;
    }
}

/* Responsive link cards */
@media (max-width: 640px) {
    #links-list .uk-card [uk-grid] {
        flex-wrap: wrap;
    }
    #links-list .uk-card [uk-grid] > .uk-width-expand {
        width: calc(100% - 80px);
        flex: none;
    }
    #links-list .uk-card [uk-grid] > .uk-width-auto:last-child {
        width: 100%;
        margin-top: 5px;
    }
}

/* Responsive bulk bar */
@media (max-width: 640px) {
    .bulk-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .bulk-bar-actions {
        width: 100%;
    }
}
