/* youtube-playlist-popup/assets/style.css */

/*
 * ----------------------------------------------------
 * 목록 컨테이너
 * ----------------------------------------------------
 */
.ytpp-list-container {
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee; 
    border-radius: 10px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.ytpp-list-container.has-shadow {
    background-color: #fcfcfc;
    box-shadow: inset 0px 4px 8px -4px rgba(0, 0, 0, 0.1), 
                inset 0px -4px 8px -4px rgba(0, 0, 0, 0.1);
}

.ytpp-list-container::-webkit-scrollbar {
    display: none;
}

.ytpp-items-wrapper {
    padding: 10px 20px;
}
/* Layout specific padding */
.ytpp-layout-tabs .ytpp-items-wrapper {
    padding-top: 20px;
}


/*
 * ----------------------------------------------------
 * 목록 아이템 (링크)
 * ----------------------------------------------------
 */
.ytpp-list-container a.ytpp-video-link {
    display: flex;
    align-items: center;
    text-decoration: none !important; 
    line-height: 1.5;
    transition: background 0.2s ease;
    border-bottom: 1px solid #eee;
    text-align: left;
    cursor: pointer;
}

.ytpp-items-wrapper a.ytpp-video-link:last-child,
.ytpp-items-wrapper a.ytpp-video-link:last-of-type {
    border-bottom: none;
}

.ytpp-list-container a.ytpp-video-link:hover {
    background-color: #f5f5f5;
}

.ytpp-layout-accordion a.ytpp-video-link.active {
    background-color: #f0f3f7;
    font-weight: 600;
}

.ytpp-layout-accordion a.ytpp-video-link.active::before {
    transform: rotate(90deg);
}

/*
 * ----------------------------------------------------
 * 아이콘, 썸네일, 텍스트 스타일
 * ----------------------------------------------------
 */

.ytpp-layout-accordion a.ytpp-video-link::before {
    content: "►"; 
    color: #4a80c2;
    font-size: 0.7em;
    margin-right: 1em;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.ytpp-thumbnail-wrapper {
    flex-shrink: 0;
    width: 120px;
    margin-right: 1em;
}

.ytpp-thumbnail {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.ytpp-text-wrapper {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
}

.ytpp-video-title {
    font-weight: 500;
    font-size: 1em; 
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ytpp-meta-info {
    display: flex;
    align-items: center;
    font-size: 0.85em;
    font-weight: 400;
    opacity: 0.8;
    margin-top: 4px;
    color: #555;
}

.ytpp-separator { margin: 0 0.5em; font-size: 0.9em; }

/*
 * ----------------------------------------------------
 * 아코디언 플레이어 스타일
 * ----------------------------------------------------
 */
.ytpp-player-container { padding: 15px 0 10px 0; border-bottom: 1px solid #eee; }
.ytpp-player-wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 8px; }
.ytpp-player-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/*
 * ----------------------------------------------------
 * 영상 설명 스타일
 * ----------------------------------------------------
 */
.ytpp-video-description { margin-top: 15px; padding: 12px; color: #333; line-height: 1.6; background-color: #f9f9f9; border-radius: 6px; white-space: pre-wrap; word-wrap: break-word; }

/*
 * ----------------------------------------------------
 * 더 로드 버튼 / 컨트롤 래퍼
 * ----------------------------------------------------
 */
.ytpp-controls-wrapper {
    border-top: 1px solid #eee;
}
.ytpp-load-more-button { display: block; width: 100%; padding: 12px 0; border: none; background-color: #f7f7f7; color: #555; font-size: 15px; font-weight: 600; cursor: pointer; transition: background-color 0.2s ease; outline: none; }
.ytpp-load-more-button:hover { background-color: #e9e9e9; }
.ytpp-load-more-button:disabled { cursor: not-allowed; background-color: #fcfcfc; color: #999; }

/*
 * ----------------------------------------------------
 * ▼▼▼ NEW: 탭(Tab) 레이아웃 스타일 ▼▼▼
 * ----------------------------------------------------
 */
.ytpp-tabs-nav {
    display: flex;
    border-bottom: 1px solid #ddd;
    background-color: #f9f9f9;
}
.ytpp-tab-link {
    padding: 12px 18px;
    cursor: pointer;
    text-decoration: none;
    color: #555;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease-in-out;
    margin-bottom: -1px;
}
.ytpp-tab-link:hover {
    background-color: #f0f0f0;
    color: #333;
}
.ytpp-tab-link.active {
    color: #005b9f;
    border-bottom-color: #005b9f;
    background-color: #fff;
}
.ytpp-tab-content {
    display: none;
}
.ytpp-tab-content.active {
    display: block;
}

/*
 * ----------------------------------------------------
 * ▼▼▼ NEW: 드롭다운(Dropdown) 메뉴 스타일 (모바일용) ▼▼▼
 * ----------------------------------------------------
 */
.ytpp-tabs-dropdown-wrapper {
    display: none; /* 기본적으로 숨김 */
    padding: 10px 15px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #ddd;
}
.ytpp-tabs-dropdown {
    width: 100%;
    padding: 10px 8px;
    font-size: 15px;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%208l5%205%205-5z%22%20fill%3D%22%23555%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    cursor: pointer;
}


/*
 * ----------------------------------------------------
 * ▼▼▼ NEW: 페이지네이션(Pagination) 스타일 ▼▼▼
 * ----------------------------------------------------
 */
.ytpp-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #fdfdfd;
}
.ytpp-page-link {
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid #ddd;
    color: #005b9f;
    background-color: #fff;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.2s ease;
}
.ytpp-page-link:hover {
    background-color: #f5f5f5;
}
.ytpp-page-link.disabled {
    color: #aaa;
    background-color: #f9f9f9;
    border-color: #eee;
    cursor: not-allowed;
    pointer-events: none;
}

/*
 * ----------------------------------------------------
 * ▼▼▼ NEW: 반응형 (모바일) 스타일 ▼▼▼
 * ----------------------------------------------------
 */
@media (max-width: 768px) {

    /* ▼▼▼ 탭 레이아웃 변경: 탭 -> 드롭다운 ▼▼▼ */
    .ytpp-layout-tabs .ytpp-tabs-nav {
        display: none; /* 기존 탭 메뉴 숨기기 */
    }
    .ytpp-layout-tabs .ytpp-tabs-dropdown-wrapper {
        display: block; /* 드롭다운 메뉴 보이기 */
    }


    /* 컨테이너 내부 여백 축소 */
    .ytpp-items-wrapper {
        padding: 10px 15px;
    }

    /* 탭/페이지네이션 여백 축소 */
    .ytpp-layout-tabs .ytpp-items-wrapper {
        padding-top: 15px;
    }
    .ytpp-pagination {
        padding: 10px 15px;
    }

    /* 썸네일과 텍스트 레이아웃 변경 (모바일 전용) */
    .ytpp-list-container a.ytpp-video-link {
        flex-direction: column; /* 세로 방향으로 정렬 */
        align-items: flex-start; /* 왼쪽 정렬 */
        padding-top: 10px !important; /* 위쪽 여백 */
        padding-bottom: 10px !important; /* 아래쪽 여백 */
    }

    /* 썸네일 크기 조정 및 하단 여백 추가 */
    .ytpp-thumbnail-wrapper {
        width: 100%; /* 너비를 100%로 설정 */
        margin-right: 0; /* 오른쪽 여백 제거 */
        margin-bottom: 0.5em; /* 썸네일 아래에 여백 추가 */
    }
    .ytpp-thumbnail {
        width: 100%; /* 썸네일 이미지가 부모 너비에 맞게 */
        height: auto;
    }

    /* 텍스트 래퍼 스타일 조정 */
    .ytpp-text-wrapper {
        width: 100%; /* 너비를 100%로 설정하여 썸네일 아래에 배치 */
        padding-left: 0; /* 왼쪽 여백 제거 */
    }

    /* 제목 스타일 변경 (2줄까지 허용) */
    .ytpp-video-title {
        white-space: normal; /* 줄바꿈 허용 */
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2; /* 2줄로 제한 */
        -webkit-box-orient: vertical;
        line-height: 1.4;
        margin-bottom: 0.2em; /* 제목 아래 여백 추가 */
    }

    /* 전체적인 폰트 크기 조정 */
    .ytpp-list-container a.ytpp-video-link,
    .ytpp-video-title {
        font-size: 15px; /* 기본 글자 크기 약간 줄임 */
    }
    .ytpp-meta-info {
        font-size: 0.8em; /* 메타 정보 글자 크기 약간 줄임 */
        margin-top: 0; /* 기본 마진 제거 */
    }
    .ytpp-load-more-button,
    .ytpp-tab-link {
        font-size: 14px; /* 버튼/탭 글자 크기 줄임 */
    }
    .ytpp-page-link {
        padding: 6px 12px;
        font-size: 13px;
    }

    /* 아코디언 아이콘 위치 조정 */
    .ytpp-layout-accordion a.ytpp-video-link::before {
        position: absolute;
        top: 10px;
        right: 15px;
        margin-right: 0;
    }
     .ytpp-layout-accordion a.ytpp-video-link {
        position: relative; /* ::before 요소의 기준점 */
        padding-right: 40px !important; /* 아이콘 공간 확보 */
    }

}

@media (max-width: 480px) {

    .ytpp-list-container a.ytpp-video-link,
    .ytpp-video-title {
        font-size: 14px; /* 글자 크기 더 작게 */
    }
    
    .ytpp-meta-info {
        /* 작은 화면에서는 채널명/날짜가 길 경우 줄바꿈되도록 함 */
        flex-wrap: wrap;
    }
    .ytpp-separator {
        /* 줄바꿈 시 구분자가 이상하게 보이지 않도록 함 */
        margin: 0 0.4em;
    }
}