/* bx_cloud - Cloud Module Styles */

.bx-cloud-wrap,
.bx-cloud-profile-wrap {
    position: relative;
    padding: 10px;
}

/* Toolbar */
.bx-cloud-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.bx-cloud-title {
    margin: 0;
    font-size: 1.2em;
}

/* Topbar */
.bx-cloud-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 12px;
    padding-bottom: 0;
    flex-wrap: wrap;
    gap: 8px;
}
.bx-cloud-tabs {
    display: flex;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.bx-cloud-tabs::-webkit-scrollbar {
    display: none;
}
.bx-cloud-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 10px 18px;
    font-size: 0.95em;
    cursor: pointer;
    color: #555;
    margin-bottom: -2px;
    flex-shrink: 0;
    white-space: nowrap;
    transition: color .15s, border-color .15s;
}
.bx-cloud-tab:hover {
    color: #007bff;
}
.bx-cloud-tab.active {
    color: #007bff;
    border-bottom-color: #007bff;
    font-weight: 600;
}
.bx-cloud-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 4px;
}

/* Share popup */
.bx-cloud-share-wrap {
    position: relative;
}
.bx-cloud-share-popup {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
    min-width: 240px;
    z-index: 1000;
    padding: 8px 0;
}
.bx-cloud-share-popup-item {
    padding: 2px 0;
}
.bx-cloud-share-popup-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: none;
    border: none;
    padding: 10px 16px;
    font-size: 0.9em;
    cursor: pointer;
    color: #333;
    text-align: left;
    transition: background .1s;
}
.bx-cloud-share-popup-btn:hover {
    background: #f5f5f5;
}
.bx-cloud-share-popup-btn.active {
    background: #e8f0fe;
    color: #007bff;
}
.bx-cloud-share-popup-select {
    display: none;
    width: calc(100% - 32px);
    margin: 0 16px 8px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85em;
}
.bx-cloud-share-popup-footer {
    border-top: 1px solid #eee;
    padding: 10px 16px 6px;
    text-align: right;
}

/* Album tabs */
.bx-cloud-albums-bar {
    margin-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}
.bx-cloud-album-tabs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.bx-cloud-album-tab {
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    background: #f7f7f7;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 6px;
}
.bx-cloud-album-tab.active {
    background: #fff;
    border-bottom-color: #fff;
    font-weight: bold;
}
.bx-cloud-album-del {
    color: #999;
    font-size: 1.1em;
    line-height: 1;
    cursor: pointer;
}
.bx-cloud-album-del:hover {
    color: #c00;
}

/* Items grid */
.bx-cloud-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.bx-cloud-item {
    width: 220px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
    position: relative;
    transition: box-shadow .15s;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.bx-cloud-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.bx-cloud-item-thumb {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    background: #eee;
}
.bx-cloud-item-icon {
    width: 100%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    color: #999;
    background: #f5f5f5;
}
.bx-cloud-item-footer {
    padding: 8px 10px 6px;
    font-size: 0.82em;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}
.bx-cloud-item-actions {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 36px;
    gap: 0;
    flex-direction: row;
    background: rgba(0,0,0,.45);
    justify-content: center;
    align-items: center;
    gap: 8px;
    opacity: 1;
    pointer-events: auto;
}
.bx-cloud-item-btn {
    background: rgba(255,255,255,.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,.4);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 0.9em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bx-cloud-item-btn:hover {
    background: rgba(255,255,255,.35);
}
.bx-cloud-item.sortable-ghost {
    opacity: .4;
}
.bx-cloud-item.selected {
    outline: 3px solid #007bff;
    outline-offset: -3px;
}
.bx-cloud-album-share-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #e8f0fe;
    border: 1px solid #c5d8fb;
    border-radius: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.bx-cloud-album-share-title {
    font-weight: 600;
    color: #333;
    flex: 1;
    min-width: 120px;
}
.bx-cloud-item-check {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 10;
    cursor: pointer;
}
.bx-cloud-item-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #007bff;
}
.bx-cloud-bulk-bar {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #e8f0fe;
    border: 1px solid #c5d8fb;
    border-radius: 6px;
    margin-bottom: 10px;
}
.bx-cloud-bulk-bar.visible {
    display: flex;
}
.bx-cloud-bulk-count {
    font-size: 0.9em;
    color: #333;
    flex: 1;
}

/* Empty */
.bx-cloud-empty {
    color: #888;
    padding: 20px;
    text-align: center;
    font-style: italic;
}

/* Modals */
.bx-cloud-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bx-cloud-modal-inner {
    background: #fff;
    border-radius: 8px;
    min-width: 320px;
    max-width: 480px;
    width: 90%;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,.2);
}
.bx-cloud-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    font-weight: bold;
}
.bx-cloud-modal-close {
    background: none;
    border: none;
    font-size: 1.4em;
    cursor: pointer;
    color: #888;
    line-height: 1;
}
.bx-cloud-modal-body {
    padding: 16px;
}
.bx-cloud-modal-footer {
    padding: 12px 16px;
    border-top: 1px solid #eee;
    text-align: right;
}

/* Share targets */
.bx-cloud-share-targets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.bx-cloud-share-target-btn {
    border: 2px solid #ddd;
    border-radius: 6px;
    padding: 8px 14px;
    cursor: pointer;
    background: #f7f7f7;
    font-size: 0.9em;
    transition: border-color .15s, background .15s;
}
.bx-cloud-share-target-btn.selected {
    border-color: #007bff;
    background: #e8f0fe;
}
.bx-cloud-share-context {
    margin-top: 8px;
}
.bx-cloud-share-context select {
    width: 100%;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Add to Cloud button (injected near share buttons) */
.bx-cloud-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border: 1px solid #aaa;
    border-radius: 4px;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 0.85em;
    color: #333;
    transition: background .15s;
    user-select: none;
    margin-left: 6px;
}
.bx-cloud-add-btn:hover {
    background: #e0e0e0;
}
.bx-cloud-add-btn.added {
    color: #2a7a2a;
    border-color: #2a7a2a;
    background: #eaffea;
}

/* Migration block */
.bx-cloud-migration-wrap {
    padding: 10px;
}
.bx-cloud-migration-result {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    background: #eaffea;
    color: #2a7a2a;
}

/* External share links are removed via BxCloudShare (BxDolShare override), not CSS. */

/* Profile cloud view */
.bx-cloud-items-profile .bx-cloud-item {
    width: 110px;
}
.bx-cloud-items-profile .bx-cloud-item-thumb,
.bx-cloud-items-profile .bx-cloud-item-icon {
    height: 80px;
}

/* Filter buttons */
.bx-cloud-filter-bar {
    display: flex;
    gap: 8px;
    padding: 8px 0 12px 0;
}
.bx-cloud-filter-btn {
    padding: 5px 14px;
    border: 1px solid #ccc;
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: #555;
}
.bx-cloud-filter-btn.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}
.bx-cloud-filter-btn:hover {
    background: #e8f0fe;
    border-color: #007bff;
    color: #007bff;
}
.bx-cloud-filter-btn.active:hover {
    background: #0069d9;
    color: #fff;
}

/* My Folders bar */
.bx-cloud-folders-bar {
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 12px;
}
.bx-cloud-folders-label {
    font-size: 0.85em;
    color: #888;
    margin-bottom: 8px;
}
.bx-cloud-folders-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    list-style: none;
    margin: 0;
    padding: 0 0 10px 0;
}
.bx-cloud-folder-card {
    width: 90px;
    flex-shrink: 0;
    text-align: center;
    cursor: pointer;
}
.bx-cloud-folder-card-icon {
    width: 72px;
    height: 60px;
    margin: 0 auto 4px;
    border-radius: 8px;
    background: #f2f2f2;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}
.bx-cloud-folder-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.bx-cloud-folder-card-icon .sys-icon {
    font-size: 24px;
    color: #888;
}
.bx-cloud-folder-card.bx-cloud-folder-uploads .bx-cloud-folder-card-icon {
    background: #e8f0fe;
}
.bx-cloud-folder-card.bx-cloud-folder-uploads .sys-icon {
    color: #1a73e8;
}
.bx-cloud-folder-card.active .bx-cloud-folder-card-icon {
    border-color: #1a73e8;
    border-width: 2px;
}
.bx-cloud-folder-card-title {
    font-size: 0.8em;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bx-cloud-folder-card.sortable-ghost {
    opacity: 0.4;
}

/* Old text-tabs album row - replaced by the new My Folders bar (Option B) */
.bx-cloud-albums-bar {
    display: none !important;
}
}
/* Folder breadcrumb - shown above the item grid when a folder filter is active */
.bx-cloud-folder-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    background: #e8f0fe;
    border-radius: 6px;
    padding: 8px 14px;
    margin-bottom: 12px;
    font-size: 0.9em;
}
.bx-cloud-folder-breadcrumb-icon .sys-icon {
    color: #1a73e8;
    margin-right: 6px;
}
.bx-cloud-folder-breadcrumb-title {
    font-weight: 600;
    color: #333;
}
.bx-cloud-folder-breadcrumb-clear {
    color: #1a73e8;
    cursor: pointer;
    margin-left: 24px;
}
.bx-cloud-folder-breadcrumb-clear:hover {
    text-decoration: underline;
}

/* Storage usage card */
.bx-cloud-quota-card {
    background: #f7f7f7;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 16px;
}
.bx-cloud-quota-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}
.bx-cloud-quota-title {
    font-size: 0.95em;
    font-weight: 600;
    color: #333;
}
.bx-cloud-quota-summary {
    font-size: 0.85em;
    color: #666;
}
.bx-cloud-quota-bar-track {
    height: 8px;
    background: #e0e0e0;
    border-radius: 99px;
    overflow: hidden;
}
.bx-cloud-quota-bar-fill {
    height: 100%;
    width: 0%;
    background: #1a73e8;
    border-radius: 99px;
    transition: width 0.3s;
}
.bx-cloud-quota-bar-fill.bx-cloud-quota-warn {
    background: #e0453a;
}
