/* ── Album page design tokens ── */
:root {
    --pf-accent: #c4848f;
    --pf-accent-rgb: 196, 132, 143;
    --pf-accent-dark: #b06b76;
    --pf-accent-gradient: linear-gradient(135deg, #c4848f, #7a7580);
    --pf-radius: 12px;
    --pf-shadow-sm: 0 2px 8px rgba(0,0,0,.06);
    --pf-shadow-md: 0 4px 20px rgba(0,0,0,.08);
}

/* ── Navigation bar ── */
.pf-album-nav {
    background: #fff;
    border-bottom: 1px solid #e8e0e2;
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--pf-shadow-sm);
}
.pf-album-nav__arrows {
    display: flex;
    gap: 4px;
}
.pf-album-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    border-radius: 20px;
    text-decoration: none !important;
    transition: background .2s, color .2s;
}
.pf-album-nav__link:hover {
    background: rgba(var(--pf-accent-rgb), .08);
    color: var(--pf-accent);
}

/* ── Album section ── */
.pf-album {
    background: #faf8f9;
}

/* ── Gallery grid ── */
.pf-album-gallery__item {
    border-radius: var(--pf-radius);
    overflow: hidden;
    box-shadow: var(--pf-shadow-sm);
    transition: box-shadow .3s;
}
.pf-album-gallery__item:hover {
    box-shadow: var(--pf-shadow-md);
}
.pf-album-gallery__item .thumb-info {
    border: none;
    border-radius: var(--pf-radius);
    background: transparent;
}
.pf-album-gallery__item .thumb-info img {
    border-radius: var(--pf-radius);
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}
.pf-album-gallery__item--hero .thumb-info img {
    aspect-ratio: 4 / 3;
}

/* ── Info sidebar ── */
.pf-album-info {
    background: #fff;
    border-radius: var(--pf-radius);
    padding: 28px;
    box-shadow: var(--pf-shadow-sm);
    border: 1px solid #e8e0e2;
}

/* Master card */
.pf-album-master {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(var(--pf-accent-rgb), .06);
    border-radius: var(--pf-radius);
    text-decoration: none !important;
    margin-bottom: 20px;
    transition: background .2s;
}
.pf-album-master:hover {
    background: rgba(var(--pf-accent-rgb), .12);
}
.pf-album-master__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--pf-accent);
    flex-shrink: 0;
}
.pf-album-master__name {
    font-weight: 700;
    font-size: 15px;
    color: #2e353e;
    line-height: 1.2;
}
.pf-album-master__role {
    font-size: 12px;
    color: #999;
}

/* Avatar wrapper for badge overlay */
.pf-album-master__avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

/* VIP crown badge */
.pf-album-master__vip {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f5c518;
    color: #fff;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

/* Lock badge for private profiles */
.pf-album-master__lock {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #777;
    color: #fff;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

/* Private master card — no hover, dimmed */
.pf-album-master--private {
    cursor: default;
    opacity: .8;
}
.pf-album-master--private:hover {
    background: rgba(var(--pf-accent-rgb), .06);
}
.pf-album-master__role--private {
    color: #999;
}
.pf-album-master__role--private i {
    margin-right: 2px;
}

/* Private notice (replaces CTA when profile is private) */
.pf-album-private-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: #f5f3f4;
    border-radius: var(--pf-radius);
    font-size: 13px;
    color: #777;
    margin-bottom: 24px;
}
.pf-album-private-notice i {
    color: #aaa;
    font-size: 16px;
}

/* Title */
.pf-album-title {
    font-weight: 700;
    font-size: 20px;
    color: #2e353e;
    margin-bottom: 12px;
}

/* Meta row */
.pf-album-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: #777;
    margin-bottom: 20px;
}
.pf-album-meta i {
    margin-right: 4px;
    color: var(--pf-accent);
    opacity: .7;
}

/* Description */
.pf-album-desc {
    font-size: 14px;
    line-height: 1.7;
    color: #555;
    margin-bottom: 24px;
}
.pf-album-desc p:last-child { margin-bottom: 0; }

/* CTA */
.pf-album-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    color: #fff !important;
    background: var(--pf-accent-gradient);
    border: none;
    border-radius: 28px;
    box-shadow: 0 4px 15px rgba(var(--pf-accent-rgb), .35);
    transition: transform .2s, box-shadow .2s;
    text-decoration: none !important;
    margin-bottom: 24px;
}
.pf-album-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(var(--pf-accent-rgb), .45);
    color: #fff !important;
}

/* Procedures list */
.pf-album-procedures {
    border-top: 1px solid #e8e0e2;
    padding-top: 20px;
    margin-bottom: 20px;
}
.pf-album-procedures h6 {
    font-size: 14px;
    font-weight: 700;
    color: #2e353e;
    margin-bottom: 12px;
}
.pf-album-procedures ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.pf-album-procedures li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    font-size: 13px;
    color: #555;
    border-bottom: 1px solid #f0eded;
}
.pf-album-procedures li:last-child { border-bottom: none; }
.pf-album-procedures li i {
    color: var(--pf-accent);
    flex-shrink: 0;
}
.pf-album-procedures li span { flex: 1; }
.pf-album-procedures__btn {
    padding: 4px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--pf-accent) !important;
    border: 1px solid var(--pf-accent);
    border-radius: 16px;
    text-decoration: none !important;
    transition: background .2s, color .2s;
    white-space: nowrap;
}
.pf-album-procedures__btn:hover {
    background: var(--pf-accent);
    color: #fff !important;
}

/* Owner actions */
.pf-album-owner-actions {
    border-top: 1px solid #e8e0e2;
    padding-top: 16px;
    display: flex;
    gap: 8px;
}
.pf-album-owner-actions__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #555 !important;
    background: #f5f3f4;
    border-radius: 20px;
    text-decoration: none !important;
    transition: background .2s, color .2s;
}
.pf-album-owner-actions__btn:hover {
    background: rgba(var(--pf-accent-rgb), .1);
    color: var(--pf-accent) !important;
}

/* ── Create/Update page layout ── */
.cf-section {
    background: #faf8f9;
    padding: 40px 0;
}

.cf-heading {
    color: #2e353e;
    font-size: 1.75rem;
    font-weight: 700;
    padding-bottom: 8px;
    border-bottom: 3px solid var(--pf-accent);
    display: inline-block;
    margin-bottom: 24px;
}

.cf-card {
    background: #fff;
    border-radius: var(--pf-radius);
    border: 1px solid #e8e0e2;
    padding: 28px 32px;
    box-shadow: var(--pf-shadow-sm);
}

.cf-back-link {
    color: var(--pf-accent-dark);
    font-weight: 500;
    text-decoration: none;
    transition: color .2s;
}

.cf-back-link:hover {
    color: var(--pf-accent);
    text-decoration: none;
}

/* ── Form inputs (create/update) ── */
.cf-card .form-group label {
    color: #555;
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: 6px;
}

.cf-card .form-group .form-control,
.cf-card .form-group .custom-select,
.cf-card .form-group select.form-control.custom-select {
    -webkit-border-radius: 8px !important;
    -moz-border-radius: 8px !important;
    border-radius: 8px !important;
    border: 1px solid #e0d8db;
    padding: 10px 14px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
    transition: border-color .2s, box-shadow .2s;
}

.cf-card .form-group .form-control:focus,
.cf-card .form-group .custom-select:focus {
    border-color: var(--pf-accent);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06), 0 0 0 3px rgba(var(--pf-accent-rgb), .12);
}

.cf-card .help-block {
    color: #888;
    font-size: .85rem;
    margin-top: 4px;
}

/* ── Form buttons (PowerComponents) ── */
.cf-card .form-buttons {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e8e0e2;
    margin-bottom: -8px;
}

.cf-card .form-buttons .loading-indicator-container > div {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}

/* Style "Save" and "Save & Close" buttons */
.cf-card .form-buttons .btn.btn-default {
    background: var(--pf-accent-gradient);
    border: none;
    color: #fff !important;
    border-radius: 4px;
    padding: 7px 20px;
    font-size: 14px;
    font-weight: 600;
    transition: opacity .2s, box-shadow .2s;
    box-shadow: 0 3px 10px rgba(var(--pf-accent-rgb), .3);
}

.cf-card .form-buttons .btn.btn-default:hover {
    opacity: .9;
    box-shadow: 0 4px 14px rgba(var(--pf-accent-rgb), .45);
}

/* Cancel + Delete → pushed right */
.cf-card .form-buttons .btn-text {
    margin-left: auto;
    font-size: 0;
}

.cf-card .form-buttons .btn-text a {
    display: inline-block;
    padding: 7px 20px;
    border: 1px solid #d1d6d9;
    border-radius: 4px;
    color: #555 !important;
    font-size: 14px;
    font-weight: 400;
    text-decoration: none !important;
    transition: border-color .2s, color .2s;
}

.cf-card .form-buttons .btn-text a:hover {
    border-color: var(--pf-accent);
    color: var(--pf-accent) !important;
}

/* Delete → icon-only red bin */
.cf-card .form-buttons .btn.btn-danger {
    background: none;
    border: none;
    color: #d9534f !important;
    padding: 7px 8px;
    font-size: 0;
    line-height: 1;
    transition: opacity .2s;
}

.cf-card .form-buttons .btn.btn-danger .oc-icon-trash-o {
    font-size: 16px;
}

.cf-card .form-buttons .btn.btn-danger:hover {
    opacity: .7;
}

/* ── Breadcrumb ── */
.cf-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: .85rem;
}

.cf-breadcrumb__item {
    color: #777;
    text-decoration: none !important;
    transition: color .2s;
}

a.cf-breadcrumb__item:hover {
    color: var(--pf-accent);
}

.cf-breadcrumb__item--active {
    color: #2e353e;
    font-weight: 600;
}

.cf-breadcrumb__sep {
    color: #ccc;
    font-size: .65rem;
}


/* Fix heading inside flex row */
.pf-page .d-flex .cf-heading {
    display: block !important;
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    font-size: 1.5rem !important;
    white-space: nowrap !important;
}

/* ── Owner album card (user list) ── */
.pf-owner-card {
    background: #fff;
    border-radius: var(--pf-radius);
    border: 1px solid #e8e0e2;
    box-shadow: var(--pf-shadow-sm);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow .3s, transform .3s;
}
.pf-owner-card:hover {
    box-shadow: var(--pf-shadow-md);
    transform: translateY(-2px);
}
.pf-owner-card__img-wrap {
    position: relative;
    overflow: hidden;
}
.pf-owner-card__img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}
.pf-owner-card__placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f3f4;
    color: #ccc;
}
.pf-owner-card__count {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,.6);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
}
.pf-owner-card__status {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
}
.pf-owner-card__status--active {
    background: rgba(40,167,69,.9);
    color: #fff;
}
.pf-owner-card__status--inactive {
    background: rgba(108,117,125,.85);
    color: #fff;
}
.pf-owner-card__body {
    padding: 14px 16px 8px;
    flex: 1;
}
.pf-owner-card__title {
    font-size: 14px;
    font-weight: 700;
    color: #2e353e;
    margin-bottom: 6px;
    line-height: 1.3;
}
.pf-owner-card__title a {
    color: inherit;
    text-decoration: none !important;
}
.pf-owner-card__title a:hover {
    color: var(--pf-accent);
}
.pf-owner-card__meta {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}
.pf-owner-card__meta i {
    color: var(--pf-accent);
    opacity: .7;
    margin-right: 3px;
}
.pf-owner-card__actions {
    display: flex;
    border-top: 1px solid #e8e0e2;
    padding: 0;
}
.pf-owner-card__btn {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #555 !important;
    text-decoration: none !important;
    transition: background .2s, color .2s;
}
.pf-owner-card__btn:first-child {
    border-right: 1px solid #e8e0e2;
}
.pf-owner-card__btn:hover {
    background: rgba(var(--pf-accent-rgb), .08);
    color: var(--pf-accent) !important;
}
.pf-owner-card__btn i {
    margin-right: 4px;
}

/* ── OctoberCMS popup (file-upload config modal) Bootstrap 4 compatibility ── */
/*
 * OctoberCMS popup.js targets Bootstrap 3 (.modal.in), but the site uses Bootstrap 4 (.modal.show).
 * Bootstrap 4 adds class "show" instead of "in" when a modal is shown. Ensure the popup
 * control-popup modal-dialog is visible when Bootstrap 4 adds the "show" class.
 */
.control-popup.modal.show .modal-dialog {
    opacity: 1 !important;
    transform: scale(1) !important;
    -webkit-transform: scale(1) !important;
}

.fileupload-config-form .file-upload-modal-image-header img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    max-height: 400px;
    object-fit: contain;
}

/* ── Responsive ── */
@media (max-width: 991px) {
    .pf-album-info {
        margin-top: 24px;
    }
    .pf-album-gallery__item--hero .thumb-info img {
        aspect-ratio: 1 / 1;
    }
}
