/**
 * coupairfrm_up - 목록 스타일
 */

/* ===== 상단 컨트롤 ===== */
.cfrm-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.cfrm-left,
.cfrm-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cfrm-category select {
    padding: 8px 12px;
    border: 1px solid var(--form-border-color);
    border-radius: var(--form-border-radius);
    font-size: 14px;
    background: var(--card-bg-color);
}

/* ===== 페어 목록 그리드 ===== */
.cfrm-list {
    display: grid;
    grid-template-columns: repeat(var(--cols, 3), 1fr);
    gap: 20px;
}

/* ===== 페어 카드 ===== */
.cfrm-card {
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    min-height: 200px;
}

/* 화이트 테마 (기본) */
.cfrm-card.theme-white {
    background-color: #ffffff;
    border: 1px solid var(--form-border-color);
    color: #1f2937;
}

/* 배경 이미지가 있는 화이트 테마 */
.cfrm-card.theme-white[style*="background-image"] {
    color: #1f2937;
}

.cfrm-card.theme-white[style*="background-image"]::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.5) 100%);
    border-radius: 8px;
    z-index: 0;
}

.cfrm-card.theme-white:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* 블랙 테마 */
.cfrm-card.theme-black {
    background-color: #1f2937;
    border: 1px solid #374151;
    color: #f9fafb;
}

/* 배경 이미지가 있는 블랙 테마 */
.cfrm-card.theme-black[style*="background-image"] {
    color: #f9fafb;
}

.cfrm-card.theme-black[style*="background-image"]::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.85) 100%);
    border-radius: 8px;
    z-index: 0;
}

.cfrm-card.theme-black:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* 카드 내 요소들은 오버레이 위에 */
.cfrm-card > * {
    position: relative;
    z-index: 1;
}

/* ===== 카드 헤더 (페어명) ===== */
.cfrm-card-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: auto;
    min-height: 32px;
    flex-direction: column;
}

.cfrm-card-header .cfrm-title {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
}

.cfrm-card-header .cfrm-card-title {
    font-size: 13px;
    text-align: center;
    opacity: 0.7;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* ===== 캐릭터 미리보기 ===== */
.cfrm-card-chars {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.cfrm-char-thumb {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--container-bg-color);
    border: 2px solid var(--form-border-color);
}

.cfrm-char-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cfrm-char-x {
    font-size: 20px;
    font-weight: 300;
    opacity: 0.5;
}

/* 블랙 테마 캐릭터 썸네일 */
.theme-black .cfrm-char-thumb {
    background: #374151;
    border-color: #4b5563;
}

/* ===== 캐릭터 이름 ===== */
.cfrm-card-names {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 12px;
}

.cfrm-char-name {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

/* ===== 한마디 ===== */
.cfrm-card-title {
    font-size: 13px;
    text-align: center;
    opacity: 0.8;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== 정렬 버튼 ===== */
.cfrm-btn-sort {
    background: var(--card-bg-color);
    border: 1px solid var(--form-border-color);
    color: var(--content-font-color);
}

.cfrm-btn-sort:hover,
.cfrm-btn-sort.cfrm-editing {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* ===== 드래그 편집 모드 ===== */
.cfrm-list.cfrm-editing .cfrm-card {
    cursor: grab;
    animation: cfrm-shake 0.3s ease-in-out infinite alternate;
}

.cfrm-list.cfrm-editing .cfrm-card:active {
    cursor: grabbing;
}

@keyframes cfrm-shake {
    0% { transform: rotate(-0.5deg); }
    100% { transform: rotate(0.5deg); }
}

.cfrm-list.cfrm-editing .cfrm-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* sortable placeholder */
.cfrm-list .sortable-placeholder {
    background: var(--primary-color);
    opacity: 0.2;
    border: 2px dashed var(--primary-color);
    border-radius: 8px;
    min-height: 200px;
}

/* ===== 반응형 ===== */
@media (max-width: 1024px) {
    .cfrm-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .cfrm-controls {
        flex-direction: column;
        gap: 12px;
    }

    .cfrm-list {
        grid-template-columns: 1fr;
    }

    .cfrm-card {
        padding: 16px;
    }

    .cfrm-char-thumb {
        width: 56px;
        height: 56px;
    }
}
