/**
 * User Profile V2 - Styles
 * 
 * Extends gallery-v2 styles with profile header.
 * Uses same CSS variables and button styles as gallery-v2.
 * 
 * @package CoaMaker
 * @since 2.0.0
 */

/* ============================================
   CSS Variables (CoaMaker brand colors)
   ============================================ */
.coa-user-profile-v2 {
    --coa-bg: #ffffff;
    --coa-card-bg: #f8f9fa;
    --coa-card-border: rgba(0, 0, 0, 0.08);
    --coa-text: #1a1a1a;
    --coa-text-muted: rgba(26, 26, 26, 0.5);
    --coa-text-secondary: rgba(26, 26, 26, 0.7);
    --coa-red: #BB212C;
    --coa-red-dark: #991a23;
    --coa-green: #1D5E23;
    --coa-green-dark: #154a1a;
    --coa-input-bg: #ffffff;
    --coa-gap: 16px;
    position: relative;
    padding-left: 60px;
    /* Space for back button */
}

/* ============================================
   Back Button (sticky left)
   ============================================ */
.coa-profile-back {
    position: fixed;
    left: 16px;
    top: 130px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--coa-card-bg);
    border: 1px solid var(--coa-card-border);
    border-radius: 50%;
    color: var(--coa-text) !important;
    text-decoration: none;
    transition: background 0.15s;
    z-index: 100;
}

.coa-profile-back:hover {
    background: rgba(0, 0, 0, 0.05);
}

.coa-profile-back svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    .coa-user-profile-v2 {
        padding-left: 0;
    }

    .coa-profile-back {
        display: none;
    }
}

/* ============================================
   Profile Header
   ============================================ */
.coa-profile-header {
    margin-bottom: 32px;
    text-align: center;
}

/* ============================================
   Profile Picture (shortcode)
   ============================================ */
.coa-profile-picture {
    display: block;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 16px;
}

.coa-profile-picture img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.coa-profile-picture__letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--coa-green);
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1;
}

.coa-profile-header__title {
    font-size: 32px;
    font-weight: 700;
    color: var(--coa-text);
    margin-bottom: 16px;
    line-height: 1.2;
}

.coa-profile-header__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.coa-profile-header__follow-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 28px;
    padding: 0 12px;
    background: var(--coa-red);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: inherit;
    line-height: 1;
    outline: none;
    box-sizing: border-box;
}

.coa-profile-header__follow-btn:hover {
    background: var(--coa-red-dark);
}

.coa-profile-header__follow-btn.is-following {
    background: var(--coa-green);
}

.coa-profile-header__follow-btn.is-following:hover {
    background: var(--coa-green-dark);
}


.coa-profile-header__follow-count {
    font-size: 11px;
    font-weight: 600;
    color: white;
}

/* Error message */
.coa-user-profile-v2__error {
    padding: 24px;
    text-align: center;
    color: var(--coa-text-muted);
    font-size: 16px;
}

/* ============================================
   Folder Cards
   ============================================ */
.coa-folder-card {
    cursor: pointer;
}

.coa-folder-card__preview {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--coa-card-bg);
    border-radius: 8px;
}

/* Single preview image */
.coa-folder-card__thumb {
    width: 100%;
    overflow: hidden;
}

.coa-folder-card__thumb img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.coa-folder-card:hover .coa-folder-card__thumb img {
    transform: scale(1.05);
}

/* Empty folder placeholder */
.coa-folder-card__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 150px;
    color: var(--coa-text-muted);
}

/* Folder overlay (always visible, darkens on hover) */
.coa-folder-card__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 60%);
    transition: background 0.2s ease;
    border-radius: 8px;
}

.coa-folder-card:hover .coa-folder-card__overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.2) 100%);
}

.coa-folder-card__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.coa-folder-card__name {
    font-size: 18px;
    font-weight: 700;
    color: white;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.coa-folder-card__count {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
}

.coa-folder-card__private {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.coa-folder-card__private svg {
    opacity: 0.8;
}

/* Folder breadcrumb navigation */
.coa-folder-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--coa-card-bg);
    border: 1px solid var(--coa-card-border);
    border-radius: 8px;
}

.coa-folder-breadcrumb__back {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 6px;
    color: var(--coa-text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.coa-folder-breadcrumb__back:hover {
    background: rgba(0, 0, 0, 0.1);
}

.coa-folder-breadcrumb__back svg {
    width: 16px;
    height: 16px;
}

.coa-folder-breadcrumb__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--coa-text);
}

/* ============================================
   Profile Bio/Description
   ============================================ */
.coa-profile-bio {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.coa-profile-bio__view {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.coa-profile-bio__view.is-editing {
    display: none;
}

.coa-profile-bio__text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--coa-text-secondary);
    margin: 0;
}

.coa-profile-bio__text.is-truncated {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.coa-profile-bio__no-text {
    font-size: 14px;
    color: var(--coa-text-muted);
    margin: 0;
    font-style: italic;
}

/* Buttons row */
.coa-profile-bio__buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.coa-profile-bio__toggle,
.coa-profile-bio__edit-btn {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 6px;
    color: var(--coa-text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 12px;
    transition: background 0.15s ease;
}

.coa-profile-bio__toggle:hover,
.coa-profile-bio__edit-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Edit Mode */
.coa-profile-bio__edit-area {
    display: none;
    flex-direction: column;
    gap: 8px;
}

.coa-profile-bio__edit-area.is-editing {
    display: flex;
}

.coa-profile-bio__textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid var(--coa-card-border);
    border-radius: 8px;
    background: var(--coa-input-bg);
    color: var(--coa-text);
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.coa-profile-bio__textarea::placeholder {
    color: var(--coa-text-muted);
}

.coa-profile-bio__textarea:focus {
    outline: none;
    border-color: var(--coa-red);
}

.coa-profile-bio__btn-group {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.coa-profile-bio__save-btn,
.coa-profile-bio__cancel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease;
}

.coa-profile-bio__save-btn {
    background: var(--coa-red);
    color: #fff;
}

.coa-profile-bio__save-btn:hover {
    background: var(--coa-red-dark);
}

.coa-profile-bio__cancel-btn {
    background: rgba(0, 0, 0, 0.05);
    color: var(--coa-text);
}

.coa-profile-bio__cancel-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}
